changeset 22714:a34e1e7232f1

lib: Make file_lock_free(NULL) no-op
author Timo Sirainen <timo.sirainen@dovecot.fi>
date Thu, 28 Dec 2017 19:40:29 +0200
parents cb108f786fb4
children 20415dd0b85a
files src/lib/file-lock.c
diffstat 1 files changed, 3 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/lib/file-lock.c	Mon Jan 01 22:42:08 2018 +0100
+++ b/src/lib/file-lock.c	Thu Dec 28 19:40:29 2017 +0200
@@ -414,6 +414,9 @@
 {
 	struct file_lock *lock = *_lock;
 
+	if (lock == NULL)
+		return;
+
 	*_lock = NULL;
 
 	if (lock->unlink_on_free)