summaryrefslogtreecommitdiff
path: root/src/libsystemd/sd-bus/bus-creds.c
diff options
context:
space:
mode:
authorDaniel Mack <github@zonque.org>2015-09-09 09:57:29 +0200
committerDaniel Mack <github@zonque.org>2015-09-09 09:57:29 +0200
commit0fa7d1f5be847d4804eb3bf6a4c10333ea14e0bc (patch)
tree6afb70cc560bd94219f81495ff699c83b404e18c /src/libsystemd/sd-bus/bus-creds.c
parentbed2c013b6570908a114a337632000cf9c9de838 (diff)
parentece174c5439021e32ebcc858842de9586072c006 (diff)
Merge pull request #1207 from poettering/coccinelle-fixes
Coccinelle fixes
Diffstat (limited to 'src/libsystemd/sd-bus/bus-creds.c')
-rw-r--r--src/libsystemd/sd-bus/bus-creds.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/libsystemd/sd-bus/bus-creds.c b/src/libsystemd/sd-bus/bus-creds.c
index c3cc2b7212..6826e21665 100644
--- a/src/libsystemd/sd-bus/bus-creds.c
+++ b/src/libsystemd/sd-bus/bus-creds.c
@@ -107,8 +107,7 @@ _public_ sd_bus_creds *sd_bus_creds_unref(sd_bus_creds *c) {
free(c->cgroup_root);
free(c->description);
- free(c->supplementary_gids);
- c->supplementary_gids = NULL;
+ c->supplementary_gids = mfree(c->supplementary_gids);
strv_free(c->well_known_names);
c->well_known_names = NULL;
@@ -1015,10 +1014,8 @@ int bus_creds_add_more(sd_bus_creds *c, uint64_t mask, pid_t pid, pid_t tid) {
if (r != -EPERM && r != -EACCES)
return r;
} else {
- if (c->cmdline_size == 0) {
- free(c->cmdline);
- c->cmdline = NULL;
- }
+ if (c->cmdline_size == 0)
+ c->cmdline = mfree(c->cmdline);
c->mask |= SD_BUS_CREDS_CMDLINE;
}