]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - src/shared/mount-util.h
mount-util: use mfree()
[thirdparty/systemd.git] / src / shared / mount-util.h
index 6202008a81db0c90bbed2a4f3def7ea89f79bbbd..033fcd1f47a0008f14735109e2e142ccf657ea24 100644 (file)
@@ -5,6 +5,7 @@
 #include <stdio.h>
 #include <unistd.h>
 
+#include "alloc-util.h"
 #include "errno-util.h"
 #include "macro.h"
 
@@ -93,7 +94,6 @@ static inline char* umount_and_rmdir_and_free(char *p) {
         PROTECT_ERRNO;
         (void) umount_recursive(p, 0);
         (void) rmdir(p);
-        free(p);
-        return NULL;
+        return mfree(p);
 }
 DEFINE_TRIVIAL_CLEANUP_FUNC(char*, umount_and_rmdir_and_free);