we need to free the array _after_ releasing the array entries
authorWilfried Goesgens <dothebart@citadel.org>
Sun, 29 Sep 2013 15:35:14 +0000 (17:35 +0200)
committerWilfried Goesgens <dothebart@citadel.org>
Sun, 29 Sep 2013 15:35:14 +0000 (17:35 +0200)
citadel/modules/imap/imap_list.c

index 17e4106..5640ec5 100644 (file)
@@ -420,9 +420,8 @@ void imap_list(int num_parms, ConstStr *Params)
         */
        for (i=0; i<ImapFilter.num_patterns; ++i) {
                FreeStrBuf(&ImapFilter.patterns[i]);
-               free(ImapFilter.patterns);
-
        }
+       free(ImapFilter.patterns);
 
        IReplyPrintf("OK %s completed", ImapFilter.verb);
 }