diff options
author | Lennart Poettering <lennart@poettering.net> | 2015-09-08 18:43:11 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2015-09-09 08:19:27 +0200 |
commit | a1e58e8ee1c84b633d6d6d651d5328d4dd4eba5b (patch) | |
tree | 2c5288c0e505c561c779ea13b4d99e8101803ca2 /src/core/load-fragment.c | |
parent | da323858ef34a0216aa96f4089810053c90f09ce (diff) |
tree-wide: use coccinelle to patch a lot of code to use mfree()
This replaces this:
free(p);
p = NULL;
by this:
p = mfree(p);
Change generated using coccinelle. Semantic patch is added to the
sources.
Diffstat (limited to 'src/core/load-fragment.c')
-rw-r--r-- | src/core/load-fragment.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/src/core/load-fragment.c b/src/core/load-fragment.c index 542bf8eb26..0299fe7603 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; } @@ -3575,8 +3572,7 @@ int unit_load_fragment(Unit *u) { /* 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); } } |