From 48638ad4f875719a09bd99dabbd6359ef9ffa404 Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Fri, 13 Aug 2021 19:04:08 +0100 Subject: [PATCH] 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 --- hotplug-dispatch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; } -- 2.30.2