tree-wide: coccinelle fixes
Another batch of fixes (mostly) generated by Coccinelle.
This commit is contained in:
+3
-4
@@ -11,6 +11,7 @@
|
||||
#include <sys/types.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "alloc-util.h"
|
||||
#include "errno-util.h"
|
||||
#include "time-util.h"
|
||||
|
||||
@@ -107,8 +108,7 @@ static inline char *rmdir_and_free(char *p) {
|
||||
return NULL;
|
||||
|
||||
(void) rmdir(p);
|
||||
free(p);
|
||||
return NULL;
|
||||
return mfree(p);
|
||||
}
|
||||
DEFINE_TRIVIAL_CLEANUP_FUNC(char*, rmdir_and_free);
|
||||
|
||||
@@ -117,8 +117,7 @@ static inline char* unlink_and_free(char *p) {
|
||||
return NULL;
|
||||
|
||||
(void) unlink_noerrno(p);
|
||||
free(p);
|
||||
return NULL;
|
||||
return mfree(p);
|
||||
}
|
||||
DEFINE_TRIVIAL_CLEANUP_FUNC(char*, unlink_and_free);
|
||||
|
||||
|
||||
+3
-4
@@ -3,6 +3,7 @@
|
||||
|
||||
#include <sys/stat.h>
|
||||
|
||||
#include "alloc-util.h"
|
||||
#include "errno-util.h"
|
||||
|
||||
typedef enum RemoveFlags {
|
||||
@@ -25,8 +26,7 @@ static inline char *rm_rf_physical_and_free(char *p) {
|
||||
return NULL;
|
||||
|
||||
(void) rm_rf(p, REMOVE_ROOT|REMOVE_PHYSICAL|REMOVE_MISSING_OK|REMOVE_CHMOD);
|
||||
free(p);
|
||||
return NULL;
|
||||
return mfree(p);
|
||||
}
|
||||
DEFINE_TRIVIAL_CLEANUP_FUNC(char*, rm_rf_physical_and_free);
|
||||
|
||||
@@ -38,7 +38,6 @@ static inline char *rm_rf_subvolume_and_free(char *p) {
|
||||
return NULL;
|
||||
|
||||
(void) rm_rf(p, REMOVE_ROOT|REMOVE_PHYSICAL|REMOVE_SUBVOLUME|REMOVE_MISSING_OK|REMOVE_CHMOD);
|
||||
free(p);
|
||||
return NULL;
|
||||
return mfree(p);
|
||||
}
|
||||
DEFINE_TRIVIAL_CLEANUP_FUNC(char*, rm_rf_subvolume_and_free);
|
||||
|
||||
Reference in New Issue
Block a user