]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
edit-util: alloc correct amount of memory
authorMike Yuan <me@yhndnzj.com>
Wed, 22 Mar 2023 12:15:19 +0000 (20:15 +0800)
committerMike Yuan <me@yhndnzj.com>
Wed, 22 Mar 2023 15:25:25 +0000 (23:25 +0800)
src/shared/edit-util.c

index b59f129528821e832f8273ce04ccc62b45a4f0be..f1eb7987f48c52f54386971be8338e35eca6c887 100644 (file)
@@ -71,7 +71,7 @@ int edit_files_add(
         if (edit_files_contains(context, path))
                 return 0;
 
-        if (!GREEDY_REALLOC0(context->files, context->n_files + 2))
+        if (!GREEDY_REALLOC(context->files, context->n_files + 1))
                 return log_oom();
 
         new_path = strdup(path);