From: Daniel Golle Date: Mon, 4 Oct 2021 00:31:39 +0000 (+0100) Subject: uxc: fix segfault caused by use-after-free X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=97bcdcf107ddf36cbbec5cafe85f6440476d0418;p=project%2Fprocd.git uxc: fix segfault caused by use-after-free Don't free blob_buf which was sent via ubus. Signed-off-by: Daniel Golle --- diff --git a/uxc.c b/uxc.c index f67271e..a896d5f 100644 --- a/uxc.c +++ b/uxc.c @@ -586,12 +586,12 @@ static int uxc_create(char *name, bool immediately) ret = 0; if (ubus_lookup_id(ctx, "container", &id) || ubus_invoke(ctx, id, "add", req.head, NULL, NULL, 3000)) { + blob_buf_free(&req); ret = EIO; } free(jailname); free(path); - blob_buf_free(&req); return ret; }