summaryrefslogtreecommitdiffhomepage
path: root/interface-ip.c
diff options
context:
space:
mode:
authorHans Dedecker <dedeckeh@gmail.com>2018-04-12 22:08:18 +0200
committerHans Dedecker <dedeckeh@gmail.com>2018-04-12 22:09:52 +0200
commitb409c78066ea6fe2c2451ede86a2303c413b5e4b (patch)
treec9f58061ffa32dec2e1aec5af1beb38322b81bd2 /interface-ip.c
parent7aee60d2a0b4c588701361a55ef21f9cb3c902df (diff)
interface-ip: fix memory leak on error in interface_update_prefix_assignments()
Detected by coverity in CID 141267 Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
Diffstat (limited to 'interface-ip.c')
-rw-r--r--interface-ip.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/interface-ip.c b/interface-ip.c
index 6726a69..27e9e41 100644
--- a/interface-ip.c
+++ b/interface-ip.c
@@ -994,8 +994,10 @@ static void interface_update_prefix_assignments(struct device_prefix *prefix, bo
}
entry = calloc(1, sizeof(*entry));
- if (!entry)
+ if (!entry) {
+ free(c);
continue;
+ }
entry->node.key = c;
avl_insert(&assign_later, &entry->node);