summaryrefslogtreecommitdiff
path: root/src/core/load-fragment.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2015-09-09 23:05:10 +0200
committerLennart Poettering <lennart@poettering.net>2015-09-09 23:05:58 +0200
commit6796073e330f49923c5134652ee085e29fc88002 (patch)
tree74846808a3d75996ef72fa305a54c62de6f2c5f0 /src/core/load-fragment.c
parent1d1423257aa7d486e1affc7495fce83438226245 (diff)
tree-wide: make use of the fact that strv_free() returns NULL
Another Coccinelle patch.
Diffstat (limited to 'src/core/load-fragment.c')
-rw-r--r--src/core/load-fragment.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/src/core/load-fragment.c b/src/core/load-fragment.c
index b695c57da8..79dd3075c9 100644
--- a/src/core/load-fragment.c
+++ b/src/core/load-fragment.c
@@ -1888,8 +1888,7 @@ int config_parse_unit_env_file(const char *unit,
if (isempty(rvalue)) {
/* Empty assignment frees the list */
- strv_free(*env);
- *env = NULL;
+ *env = strv_free(*env);
return 0;
}
@@ -1937,8 +1936,7 @@ int config_parse_environ(const char *unit,
if (isempty(rvalue)) {
/* Empty assignment resets the list */
- strv_free(*env);
- *env = NULL;
+ *env = strv_free(*env);
return 0;
}
@@ -2245,8 +2243,7 @@ int config_parse_documentation(const char *unit,
if (isempty(rvalue)) {
/* Empty assignment resets the list */
- strv_free(u->documentation);
- u->documentation = NULL;
+ u->documentation = strv_free(u->documentation);
return 0;
}
@@ -3011,8 +3008,7 @@ int config_parse_runtime_directory(
if (isempty(rvalue)) {
/* Empty assignment resets the list */
- strv_free(*rt);
- *rt = NULL;
+ *rt = strv_free(*rt);
return 0;
}
@@ -3140,8 +3136,7 @@ int config_parse_namespace_path_strv(
if (isempty(rvalue)) {
/* Empty assignment resets the list */
- strv_free(*sv);
- *sv = NULL;
+ *sv = strv_free(*sv);
return 0;
}