1
0
mirror of https://github.com/moparisthebest/pacman synced 2024-12-21 23:38:49 -05:00

pacman: exit without memory cleanup on signals

Memory allocation/deallocation functions are not safe to call from
signal handlers.  Just remove the lock file if there is one and exit
immediately.

Fixes: FS#46375, FS#45995, FS#47011

Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
This commit is contained in:
Andrew Gregory 2015-11-12 18:37:43 -05:00 committed by Allan McRae
parent 7b6f7bbe09
commit 7fb8a299c2

View File

@ -336,10 +336,10 @@ static void handler(int signum)
}
/* SIGINT/SIGHUP: no committing transaction, release it now and then exit pacman
* SIGTERM: release no matter what */
alpm_trans_release(config->handle);
alpm_unlock(config->handle);
/* output a newline to be sure we clear any line we may be on */
xwrite(out, "\n", 1);
cleanup(128 + signum);
_Exit(128 + signum);
}
static void invalid_opt(int used, const char *opt1, const char *opt2)