]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - src/core/load-fragment.c
load-fragment: do not create empty array
[thirdparty/systemd.git] / src / core / load-fragment.c
index 2c3783a9f0d1a6fa82894c8e0e180f9ba76ebc48..5dd1787098eaea574778f037c31f403153e058a5 100644 (file)
@@ -284,19 +284,7 @@ int config_parse_unit_path_strv_printf(
         assert(u);
 
         if (isempty(rvalue)) {
-                char **empty;
-
-                /* Empty assignment resets the list. As a special rule
-                 * we actually fill in a real empty array here rather
-                 * than NULL, since some code wants to know if
-                 * something was set at all... */
-                empty = new0(char*, 1);
-                if (!empty)
-                        return log_oom();
-
-                strv_free(*x);
-                *x = empty;
-
+                *x = strv_free(*x);
                 return 0;
         }
 
@@ -1968,15 +1956,7 @@ int config_parse_user_group_strv(
         assert(u);
 
         if (isempty(rvalue)) {
-                char **empty;
-
-                empty = new0(char*, 1);
-                if (!empty)
-                        return log_oom();
-
-                strv_free(*users);
-                *users = empty;
-
+                *users = strv_free(*users);
                 return 0;
         }