From: Antonio Alvarez Feijoo Date: Tue, 30 Jan 2024 10:59:54 +0000 (+0100) Subject: conf-parser: fix OOM check X-Git-Tag: v256-rc1~1020 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0fa25bd5f4789e8b37be5dd7927bab81c18c2dcd;p=thirdparty%2Fsystemd.git conf-parser: fix OOM check --- diff --git a/src/shared/conf-parser.c b/src/shared/conf-parser.c index f5efc7618a8..40d3675b7e0 100644 --- a/src/shared/conf-parser.c +++ b/src/shared/conf-parser.c @@ -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);