]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
delta: add missing error check 36146/head
authorYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 24 Jan 2025 13:46:55 +0000 (22:46 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 24 Jan 2025 13:46:58 +0000 (22:46 +0900)
Fixes CID#1590726.

src/delta/delta.c

index e93b2ba6199004fad6b7ff307f6cb26b6a4c5fc0..62f4be578f423ec5c6d7a5308ff0e6b3233460b2 100644 (file)
@@ -262,7 +262,11 @@ static int enumerate_dir_d(
                         h = ordered_hashmap_new(&string_hash_ops_value_free);
                         if (!h)
                                 return -ENOMEM;
-                        ordered_hashmap_ensure_put(drops, &drop_hash_ops, unit, h);
+                        r = ordered_hashmap_ensure_put(drops, &drop_hash_ops, unit, h);
+                        if (r < 0) {
+                                ordered_hashmap_free(h);
+                                return r;
+                        }
                         unit = strdup(unit);
                         if (!unit)
                                 return -ENOMEM;