]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-imap: imap_match_deinit(NULL) should be a no-op
authorAki Tuomi <aki.tuomi@dovecot.fi>
Wed, 31 Jan 2018 17:48:49 +0000 (19:48 +0200)
committerTimo Sirainen <timo.sirainen@dovecot.fi>
Wed, 13 Jun 2018 08:30:51 +0000 (11:30 +0300)
src/lib-imap/imap-match.c

index 3d9bd459efab7da6863c27caefe0c7a490c19e70..076635f7c17037337e9d5de3448fbc225dba9a72 100644 (file)
@@ -172,6 +172,8 @@ imap_match_init_multiple(pool_t pool, const char *const *patterns,
 
 void imap_match_deinit(struct imap_match_glob **glob)
 {
+       if (glob == NULL || *glob == NULL)
+               return;
        p_free((*glob)->pool, (*glob)->patterns);
        p_free((*glob)->pool, *glob);
        *glob = NULL;