]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
basic/fileio: fix memleak when discarding an invalid variable
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 21 Feb 2017 16:15:19 +0000 (11:15 -0500)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 21 Feb 2017 16:15:50 +0000 (11:15 -0500)
Fixes #5405.

src/basic/fileio.c

index b9a9f748928058dbe30b99f06ad8346996c9791c..13c03b4f5591f5514ca564b6e6b8f9df4ce881df 100644 (file)
@@ -780,6 +780,7 @@ static int merge_env_file_push(
 
         if (!env_name_is_valid(key)) {
                 log_error("%s:%u: invalid variable name \"%s\", ignoring.", strna(filename), line, key);
+                free(value);
                 return 0;
         }