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/libsystemd/sd-netlink/netlink-message.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/libsystemd/sd-netlink/netlink-message.c')
-rw-r--r-- | src/libsystemd/sd-netlink/netlink-message.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/libsystemd/sd-netlink/netlink-message.c b/src/libsystemd/sd-netlink/netlink-message.c index aee2ced2d9..e2a10ae2b4 100644 --- a/src/libsystemd/sd-netlink/netlink-message.c +++ b/src/libsystemd/sd-netlink/netlink-message.c @@ -843,8 +843,7 @@ int sd_netlink_message_exit_container(sd_netlink_message *m) { assert_return(m->sealed, -EINVAL); assert_return(m->n_containers > 0, -EINVAL); - free(m->containers[m->n_containers].attributes); - m->containers[m->n_containers].attributes = NULL; + m->containers[m->n_containers].attributes = mfree(m->containers[m->n_containers].attributes); m->containers[m->n_containers].type_system = NULL; m->n_containers --; @@ -894,8 +893,7 @@ int sd_netlink_message_rewind(sd_netlink_message *m) { rtnl_message_seal(m); for (i = 1; i <= m->n_containers; i++) { - free(m->containers[i].attributes); - m->containers[i].attributes = NULL; + m->containers[i].attributes = mfree(m->containers[i].attributes); } m->n_containers = 0; |