chiark / gitweb /
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)
committerSven Eden <yamakuzure@gmx.net>
Mon, 17 Jul 2017 15:58:36 +0000 (17:58 +0200)
Fixes #5405.

src/basic/fileio.c

index eadc8b7..5cf33b4 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;
         }