From: Daniel Golle Date: Fri, 13 Aug 2021 18:04:08 +0000 (+0100) Subject: hotplug-dispatch: yet another rare memory leak disovered by Coverity X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=48638ad4f875719a09bd99dabbd6359ef9ffa404;p=project%2Fprocd.git hotplug-dispatch: yet another rare memory leak disovered by Coverity Free newly allocated hotplug context in case of premature return. Coverity CID: 1490077 Signed-off-by: Daniel Golle --- diff --git a/hotplug-dispatch.c b/hotplug-dispatch.c index cfba7d1..f1ece38 100644 --- a/hotplug-dispatch.c +++ b/hotplug-dispatch.c @@ -298,7 +298,7 @@ static int hotplug_call(struct ubus_context *ctx, struct ubus_object *obj, /* glob'ing for hotplug scripts */ if (asprintf(&globstr, "%s/%s/*", HOTPLUG_BASEDIR, subsys) == -1) { - env_free(envp); + hotplug_free(pc); return UBUS_STATUS_UNKNOWN_ERROR; }