]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - src/basic/env-util.c
tree-wide: use mfree more
[thirdparty/systemd.git] / src / basic / env-util.c
index 441169db311eb3118be49ff36267d26ebd168a83..b74290d6fd49ad721660c924c239d29f96cda990 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 <limits.h>
+#include <stdarg.h>
+#include <stdlib.h>
+#include <string.h>
 #include <unistd.h>
 
 #include "alloc-util.h"
-#include "def.h"
 #include "env-util.h"
+#include "extract-word.h"
+#include "macro.h"
 #include "parse-util.h"
 #include "string-util.h"
 #include "strv.h"
 #include "utf8.h"
-#include "util.h"
 
 #define VALID_CHARS_ENV_NAME                    \
         DIGITS LETTERS                          \
@@ -542,8 +544,7 @@ char *replace_env(const char *format, char **env) {
         return k;
 
 fail:
-        free(r);
-        return NULL;
+        return mfree(r);
 }
 
 char **replace_env_argv(char **argv, char **env) {