]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-imap-storage: Free msgpart using imap_msgpart_free()
authorAki Tuomi <aki.tuomi@open-xchange.com>
Thu, 12 Feb 2026 10:48:30 +0000 (12:48 +0200)
committerAki Tuomi <aki.tuomi@open-xchange.com>
Fri, 13 Feb 2026 07:48:36 +0000 (09:48 +0200)
src/lib-imap-storage/imap-msgpart.c

index 349a2345b6b596ed5c35a1e954910aad523faac4..d30e83a4257ed46bd9ba8d1293bce1154e065c62 100644 (file)
@@ -228,7 +228,7 @@ int imap_msgpart_parse(const char *section, struct imap_msgpart **msgpart_r)
        } else if (section[i] == '\0') {
                /* [1.2.3] */
                if (i > 0 && section[i-1] == '.') {
-                       pool_unref(&pool);
+                       imap_msgpart_free(&msgpart);
                        return -1;
                }
                msgpart->section_number = p_strdup(pool, section);
@@ -236,7 +236,7 @@ int imap_msgpart_parse(const char *section, struct imap_msgpart **msgpart_r)
        } else {
                /* [1.2.3.MIME], [1.2.3.HEADER], etc */
                if (section[i-1] != '.') {
-                       pool_unref(&pool);
+                       imap_msgpart_free(&msgpart);
                        return -1;
                }
                msgpart->section_number = p_strndup(pool, section, i-1);