From: Hans Dedecker Date: Thu, 12 Apr 2018 20:08:18 +0000 (+0200) Subject: interface-ip: fix memory leak on error in interface_update_prefix_assignments() X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=b409c78066ea6fe2c2451ede86a2303c413b5e4b;p=oweals%2Fnetifd.git interface-ip: fix memory leak on error in interface_update_prefix_assignments() Detected by coverity in CID 141267 Signed-off-by: Hans Dedecker --- 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);