]> git.ipfire.org Git - thirdparty/mlmmj.git/commitdiff
dnsparse: avoid double free
authorBaptiste Daroussin <bapt@FreeBSD.org>
Mon, 15 May 2023 09:54:50 +0000 (11:54 +0200)
committerBaptiste Daroussin <bapt@FreeBSD.org>
Mon, 15 May 2023 09:54:50 +0000 (11:54 +0200)
src/mlmmj.c

index c9834d06f6c4d1fb796f990233085763779e99a9..1ce9b5fa11e27451a8ab6b17f4ceb6c263e61258 100644 (file)
@@ -477,10 +477,8 @@ char *dsnparseaddr(const char *mailname)
                        }
                }
                if (strcmp(buf, boundary) == 0) {
-                       if (indsn) {
-                               free(buf);
+                       if (indsn)
                                break;
-                       }
                        /* check our content type is a valid one */
                        while ((hdr = gethdrline(f, NULL))) {
                                if (indsn) {
@@ -504,7 +502,7 @@ char *dsnparseaddr(const char *mailname)
                        }
                }
        }
-       free(line);
+       free(buf);
        return addr;
 }