summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrew Gregory <andrew.gregory.8@gmail.com>2015-11-12 18:37:43 -0500
committerAllan McRae <allan@archlinux.org>2015-12-05 17:57:49 +1000
commit7fb8a299c2a2e18eed21694ba24cf8959aa830dd (patch)
tree995d6069c314d4e9812179e428da389ffdf4681a /src
parent7b6f7bbe090e9c10c094c998147212ec0c1ba770 (diff)
downloadpacman-7fb8a299c2a2e18eed21694ba24cf8959aa830dd.tar.xz
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>
Diffstat (limited to 'src')
-rw-r--r--src/pacman/pacman.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/pacman/pacman.c b/src/pacman/pacman.c
index 94685a74..1d4459e3 100644
--- a/src/pacman/pacman.c
+++ b/src/pacman/pacman.c
@@ -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)