summaryrefslogtreecommitdiff
path: root/src/libsystemd/sd-netlink/netlink-message.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-netlink/netlink-message.c
parentbed2c013b6570908a114a337632000cf9c9de838 (diff)
parentece174c5439021e32ebcc858842de9586072c006 (diff)
Merge pull request #1207 from poettering/coccinelle-fixes
Coccinelle fixes
Diffstat (limited to 'src/libsystemd/sd-netlink/netlink-message.c')
-rw-r--r--src/libsystemd/sd-netlink/netlink-message.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/libsystemd/sd-netlink/netlink-message.c b/src/libsystemd/sd-netlink/netlink-message.c
index aee2ced2d9..7ac8949830 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,16 +893,14 @@ 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;
- if (m->containers[0].attributes) {
+ if (m->containers[0].attributes)
/* top-level attributes have already been parsed */
return 0;
- }
assert(m->hdr);