summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/libalpm/handle.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/libalpm/handle.c b/lib/libalpm/handle.c
index 266b4bc8..b9d71db8 100644
--- a/lib/libalpm/handle.c
+++ b/lib/libalpm/handle.c
@@ -132,10 +132,9 @@ int _alpm_handle_unlock(alpm_handle_t *handle)
ASSERT(handle->lockfile != NULL, return -1);
ASSERT(handle->lckstream != NULL, return 0);
- if(handle->lckstream != NULL) {
- fclose(handle->lckstream);
- handle->lckstream = NULL;
- }
+ fclose(handle->lckstream);
+ handle->lckstream = NULL;
+
if(unlink(handle->lockfile) && errno != ENOENT) {
return -1;
}