]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - src/basic/replace-var.c
Add SPDX license identifiers to source files under the LGPL
[thirdparty/systemd.git] / src / basic / replace-var.c
index 8c3279b376fc720966b8ad1be5f4a0a7950aa72a..c73ed9777e540e7a68e988b73418ee2e19e97b2c 100644 (file)
@@ -1,5 +1,4 @@
-/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
-
+/* SPDX-License-Identifier: LGPL-2.1+ */
 /***
   This file is part of systemd.
 
@@ -56,7 +55,7 @@ static int get_variable(const char *b, char **r) {
         return 1;
 }
 
-char *replace_var(const char *text, char *(*lookup)(const char *variable, void*userdata), void *userdata) {
+char *replace_var(const char *text, char *(*lookup)(const char *variable, void *userdata), void *userdata) {
         char *r, *t;
         const char *f;
         size_t l;
@@ -109,6 +108,5 @@ char *replace_var(const char *text, char *(*lookup)(const char *variable, void*u
         return r;
 
 oom:
-        free(r);
-        return NULL;
+        return mfree(r);
 }