alpm_unlock: check handle before dereferencing
Prevents SIGSEGV if we catch SIGINT or SIGHUP before initializing alpm. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
This commit is contained in:
parent
f4e2009e9b
commit
1bc79cb9a5
1 changed files with 1 additions and 0 deletions
|
@ -135,6 +135,7 @@ int _alpm_handle_lock(alpm_handle_t *handle)
|
||||||
*/
|
*/
|
||||||
int SYMEXPORT alpm_unlock(alpm_handle_t *handle)
|
int SYMEXPORT alpm_unlock(alpm_handle_t *handle)
|
||||||
{
|
{
|
||||||
|
ASSERT(handle != NULL, return -1);
|
||||||
ASSERT(handle->lockfile != NULL, return 0);
|
ASSERT(handle->lockfile != NULL, return 0);
|
||||||
ASSERT(handle->lockfd >= 0, return 0);
|
ASSERT(handle->lockfd >= 0, return 0);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue