diff options
author | Hans Dedecker <dedeckeh@gmail.com> | 2018-04-12 22:08:18 +0200 |
---|---|---|
committer | Hans Dedecker <dedeckeh@gmail.com> | 2018-04-12 22:09:52 +0200 |
commit | b409c78066ea6fe2c2451ede86a2303c413b5e4b (patch) | |
tree | c9f58061ffa32dec2e1aec5af1beb38322b81bd2 | |
parent | 7aee60d2a0b4c588701361a55ef21f9cb3c902df (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>
-rw-r--r-- | interface-ip.c | 4 |
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); |