]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-index: Make sure buffer is not null before freeing
authorAki Tuomi <aki.tuomi@dovecot.fi>
Mon, 19 Dec 2016 10:16:20 +0000 (12:16 +0200)
committerGitLab <gitlab@git.dovecot.net>
Mon, 19 Dec 2016 11:51:31 +0000 (13:51 +0200)
Fixes signal 11 crash under stress.

src/lib-index/mail-transaction-log-file.c

index a5da3966fbba00238e0b509235798d102c7a246c..5cc9f6020855e67275dfe18eab38f0fe772c90b3 100644 (file)
@@ -950,7 +950,8 @@ int mail_transaction_log_file_open(struct mail_transaction_log_file *file,
                }
 
                /* ESTALE - try again */
-               buffer_free(&file->buffer);
+               if (file->buffer != NULL)
+                       buffer_free(&file->buffer);
         }
 
        mail_transaction_log_file_add_to_list(file);