mirror of
https://github.com/systemd/systemd.git
synced 2026-07-13 10:59:49 +00:00
load-fragment: do not create empty array
Originally added in4589f5bb0a. C.f.8249bb728dand #6746.
This commit is contained in:
committed by
Zbigniew Jędrzejewski-Szmek
parent
8bdaf088ca
commit
9f2d41a65f
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user