From: Michael Tremer Date: Fri, 31 Jan 2025 09:50:52 +0000 (+0000) Subject: pakfire: Clean up after failing to create a temporary directory X-Git-Tag: 0.9.30~225 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d5b82e7974566716186a4e9145b21d96dd66b116;p=pakfire.git pakfire: Clean up after failing to create a temporary directory Signed-off-by: Michael Tremer --- diff --git a/src/pakfire/pakfire.c b/src/pakfire/pakfire.c index 58135e96..7f943b1c 100644 --- a/src/pakfire/pakfire.c +++ b/src/pakfire/pakfire.c @@ -1009,8 +1009,10 @@ int pakfire_create(struct pakfire** pakfire, struct pakfire_ctx* ctx, // Create a new temporary directory path = pakfire_mkdtemp(tmppath); - if (!path) - return -errno; + if (!path) { + r = -errno; + goto ERROR; + } // Destroy the temporary directory afterwards p->internal_flags |= PAKFIRE_DESTROY_ON_FREE;