]> git.ipfire.org Git - pakfire.git/commitdiff
jail: Report correct error if clone3() failed
authorMichael Tremer <michael.tremer@ipfire.org>
Mon, 16 Dec 2024 18:11:37 +0000 (18:11 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Mon, 16 Dec 2024 18:11:37 +0000 (18:11 +0000)
We should also clean up.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/libpakfire/jail.c

index f6b6a729b1a952b6c658b1a2ab04f61807017278..74989a4e34ffa69f7922e21f77568244880cba3b 100644 (file)
@@ -1533,7 +1533,8 @@ static int __pakfire_jail_exec(struct pakfire_jail* jail,
        ctx.pid = clone3(&args, sizeof(args));
        if (ctx.pid < 0) {
                ERROR(jail->ctx, "Could not clone: %m\n");
-               return -1;
+               r = -errno;
+               goto ERROR;
 
        // Child process
        } else if (ctx.pid == 0) {