]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - src/basic/replace-var.c
tree-wide: use mfree more
[thirdparty/systemd.git] / src / basic / replace-var.c
index 478fc43a38858ac34ff38b6564a4e49e04edd71a..0d21423a9c67aced489c89ff60e6abaa77f0416a 100644 (file)
@@ -1,5 +1,3 @@
-/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
-
 /***
   This file is part of systemd.
 
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
+#include <errno.h>
+#include <stddef.h>
+#include <stdlib.h>
 #include <string.h>
 
+#include "alloc-util.h"
 #include "macro.h"
-#include "util.h"
 #include "replace-var.h"
-#include "def.h"
+#include "string-util.h"
 
 /*
  * Generic infrastructure for replacing @FOO@ style variables in
@@ -106,6 +107,5 @@ char *replace_var(const char *text, char *(*lookup)(const char *variable, void*u
         return r;
 
 oom:
-        free(r);
-        return NULL;
+        return mfree(r);
 }