From: Hans Dedecker Date: Mon, 26 Nov 2018 12:55:53 +0000 (+0100) Subject: interface: fix return code of __interface_add() X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=dfa4ede4e3b2fd0f50b14fcb2dd141cd73a5c74f;p=project%2Fnetifd.git interface: fix return code of __interface_add() For dynamic interfaces don't return false if vlist_find returns NULL as the calling function will try to free iface in case of an error which has already been freed in interface_change_config() Signed-off-by: Hans Dedecker --- diff --git a/interface.c b/interface.c index 44f7a87..b21d234 100644 --- a/interface.c +++ b/interface.c @@ -922,11 +922,9 @@ static bool __interface_add(struct interface *iface, struct blob_attr *config, b iface = vlist_find(&interfaces, name, iface, node); free(name); - if (!iface) - return false; - /* Don't delete dynamic interface on reload */ - iface->node.version = -1; + if (iface) + iface->node.version = -1; } return true;