diff options
author | Daniel Mack <github@zonque.org> | 2015-09-09 09:57:29 +0200 |
---|---|---|
committer | Daniel Mack <github@zonque.org> | 2015-09-09 09:57:29 +0200 |
commit | 0fa7d1f5be847d4804eb3bf6a4c10333ea14e0bc (patch) | |
tree | 6afb70cc560bd94219f81495ff699c83b404e18c /src/core/load-fragment.c | |
parent | bed2c013b6570908a114a337632000cf9c9de838 (diff) | |
parent | ece174c5439021e32ebcc858842de9586072c006 (diff) |
Merge pull request #1207 from poettering/coccinelle-fixes
Coccinelle fixes
Diffstat (limited to 'src/core/load-fragment.c')
-rw-r--r-- | src/core/load-fragment.c | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/src/core/load-fragment.c b/src/core/load-fragment.c index 542bf8eb26..b695c57da8 100644 --- a/src/core/load-fragment.c +++ b/src/core/load-fragment.c @@ -1215,8 +1215,7 @@ int config_parse_exec_selinux_context( assert(data); if (isempty(rvalue)) { - free(c->selinux_context); - c->selinux_context = NULL; + c->selinux_context = mfree(c->selinux_context); c->selinux_context_ignore = false; return 0; } @@ -1265,8 +1264,7 @@ int config_parse_exec_apparmor_profile( assert(data); if (isempty(rvalue)) { - free(c->apparmor_profile); - c->apparmor_profile = NULL; + c->apparmor_profile = mfree(c->apparmor_profile); c->apparmor_profile_ignore = false; return 0; } @@ -1315,8 +1313,7 @@ int config_parse_exec_smack_process_label( assert(data); if (isempty(rvalue)) { - free(c->smack_process_label); - c->smack_process_label = NULL; + c->smack_process_label = mfree(c->smack_process_label); c->smack_process_label_ignore = false; return 0; } @@ -3571,13 +3568,11 @@ int unit_load_fragment(Unit *u) { if (r < 0) return r; - if (u->load_state == UNIT_STUB) { + if (u->load_state == UNIT_STUB) /* Hmm, this didn't work? Then let's get rid * of the fragment path stored for us, so that * we don't point to an invalid location. */ - free(u->fragment_path); - u->fragment_path = NULL; - } + u->fragment_path = mfree(u->fragment_path); } /* Look for a template */ |