Browse Source

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 <daniel@makrotopia.org>
Daniel Golle 2 years ago
parent
commit
48638ad4f8
1 changed files with 1 additions and 1 deletions
  1. 1 1
      hotplug-dispatch.c

+ 1 - 1
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;
 	}