From 629726dfea57d03219c00b9e8972ef3d1d550446 Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Thu, 12 Aug 2021 16:34:39 +0100 Subject: [PATCH] blockd: fix resource leak discovered by coverity scan Fixes Coverity CID 1463265 Signed-off-by: Daniel Golle --- blockd.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/blockd.c b/blockd.c index 3bfdea1..365755a 100644 --- a/blockd.c +++ b/blockd.c @@ -152,6 +152,9 @@ static int hotplug_call_mount(struct ubus_context *ctx, const char *action, pid = fork(); switch (pid) { case -1: + if (c) + free(c); + err = -errno; ULOG_ERR("fork() failed\n"); return err; -- 2.30.2