From: Baptiste Daroussin Date: Mon, 15 May 2023 09:54:50 +0000 (+0200) Subject: dnsparse: avoid double free X-Git-Tag: RELEASE_1_4_0b1~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=af0d077e71f90bf8f420a6ca68ca69a8a57da3ee;p=thirdparty%2Fmlmmj.git dnsparse: avoid double free --- diff --git a/src/mlmmj.c b/src/mlmmj.c index c9834d06..1ce9b5fa 100644 --- a/src/mlmmj.c +++ b/src/mlmmj.c @@ -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; }