]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
conf-parser: fix OOM check
authorAntonio Alvarez Feijoo <antonio.feijoo@suse.com>
Tue, 30 Jan 2024 10:59:54 +0000 (11:59 +0100)
committerLuca Boccassi <luca.boccassi@gmail.com>
Tue, 30 Jan 2024 12:46:24 +0000 (12:46 +0000)
src/shared/conf-parser.c

index f5efc7618a819b98b96bd05df1acadfdeb4f53f7..40d3675b7e07c2d74a73a9678d208736e9d520af 100644 (file)
@@ -466,7 +466,7 @@ int hashmap_put_stats_by_path(Hashmap **stats_by_path, const char *path, const s
                 return -ENOMEM;
 
         path_copy = strdup(path);
-        if (!path)
+        if (!path_copy)
                 return -ENOMEM;
 
         r = hashmap_put(*stats_by_path, path_copy, st_copy);