]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib: Make file_lock_free(NULL) no-op
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Thu, 28 Dec 2017 17:40:29 +0000 (19:40 +0200)
committerVille Savolainen <ville.savolainen@dovecot.fi>
Wed, 3 Jan 2018 10:40:28 +0000 (12:40 +0200)
src/lib/file-lock.c

index 12e22d3bdb9a78a15ce20a9c2bf396bed2f32e52..0b53f074bd11d82232dcbc5b632b201b5495a4ae 100644 (file)
@@ -414,6 +414,9 @@ void file_lock_free(struct file_lock **_lock)
 {
        struct file_lock *lock = *_lock;
 
+       if (lock == NULL)
+               return;
+
        *_lock = NULL;
 
        if (lock->unlink_on_free)