diff options
author | Lennart Poettering <lennart@poettering.net> | 2015-09-09 23:05:10 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2015-09-09 23:05:58 +0200 |
commit | 6796073e330f49923c5134652ee085e29fc88002 (patch) | |
tree | 74846808a3d75996ef72fa305a54c62de6f2c5f0 /src/shared | |
parent | 1d1423257aa7d486e1affc7495fce83438226245 (diff) | |
download | systemd-6796073e330f49923c5134652ee085e29fc88002.tar.gz systemd-6796073e330f49923c5134652ee085e29fc88002.tar.bz2 systemd-6796073e330f49923c5134652ee085e29fc88002.zip |
tree-wide: make use of the fact that strv_free() returns NULL
Another Coccinelle patch.
Diffstat (limited to 'src/shared')
-rw-r--r-- | src/shared/path-lookup.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/src/shared/path-lookup.c b/src/shared/path-lookup.c index f6a127174c..d803bbe07e 100644 --- a/src/shared/path-lookup.c +++ b/src/shared/path-lookup.c @@ -333,8 +333,7 @@ int lookup_paths_init( log_debug("Looking for unit files in (higher priority first):\n\t%s", t); } else { log_debug("Ignoring unit files."); - strv_free(p->unit_path); - p->unit_path = NULL; + p->unit_path = strv_free(p->unit_path); } if (running_as == MANAGER_SYSTEM) { @@ -390,8 +389,7 @@ int lookup_paths_init( log_debug("Looking for SysV init scripts in:\n\t%s", t); } else { log_debug("Ignoring SysV init scripts."); - strv_free(p->sysvinit_path); - p->sysvinit_path = NULL; + p->sysvinit_path = strv_free(p->sysvinit_path); } if (!strv_isempty(p->sysvrcnd_path)) { @@ -403,8 +401,7 @@ int lookup_paths_init( log_debug("Looking for SysV rcN.d links in:\n\t%s", t); } else { log_debug("Ignoring SysV rcN.d links."); - strv_free(p->sysvrcnd_path); - p->sysvrcnd_path = NULL; + p->sysvrcnd_path = strv_free(p->sysvrcnd_path); } #else log_debug("SysV init scripts and rcN.d links support disabled"); @@ -417,8 +414,7 @@ int lookup_paths_init( void lookup_paths_free(LookupPaths *p) { assert(p); - strv_free(p->unit_path); - p->unit_path = NULL; + p->unit_path = strv_free(p->unit_path); #ifdef HAVE_SYSV_COMPAT strv_free(p->sysvinit_path); |