From: David Levine Date: Fri, 21 Nov 2014 01:48:58 +0000 (-0600) Subject: Fixed double fclose() in InitMultiPart() and leaks introduced in X-Git-Url: https://diplodocus.org/git/nmh/commitdiff_plain/5f2be5a2fd2659a9a1c9bdf221936ace436a2e3f?ds=inline Fixed double fclose() in InitMultiPart() and leaks introduced in commit 5be8db81. --- diff --git a/uip/mhoutsbr.c b/uip/mhoutsbr.c index ca1acf83..0c0a2975 100644 --- a/uip/mhoutsbr.c +++ b/uip/mhoutsbr.c @@ -407,6 +407,7 @@ three_print: putc ('\n', out); (*ct->c_ceclosefnx) (ct); + free (bufp); return OK; } diff --git a/uip/mhparse.c b/uip/mhparse.c index 0ec7712e..7851e185 100644 --- a/uip/mhparse.c +++ b/uip/mhparse.c @@ -1179,7 +1179,6 @@ next_part: if (!(p = get_content (fp, ct->c_file, ct->c_subtype == MULTI_DIGEST ? -1 : 0))) { free(bufp); - fclose (ct->c_fp); ct->c_fp = NULL; return NOTOK; } @@ -2127,6 +2126,7 @@ ready_to_go: fclose (ct->c_fp); ct->c_fp = NULL; } + free (bufp); return fileno (ce->ce_fp); clean_up: @@ -2135,6 +2135,7 @@ clean_up: fclose (ct->c_fp); ct->c_fp = NULL; } + free (bufp); return NOTOK; } @@ -3550,6 +3551,7 @@ bad_quote: "%s's %s: field\n%*s(parameter %s)", sp->index, filename, fieldname, strlen(invo_name) + 2, "", nameptr); + free (nameptr); return NOTOK; } if (sp2->index < sp->index && @@ -3565,6 +3567,7 @@ bad_quote: "param in message %s's %s: field\n%*s(parameter %s)", filename, fieldname, strlen(invo_name) + 2, "", nameptr); + free (nameptr); return NOTOK; } }