]> diplodocus.org Git - nmh/commitdiff
Fixed double fclose() in InitMultiPart() and leaks introduced in
authorDavid Levine <levinedl@acm.org>
Fri, 21 Nov 2014 01:48:58 +0000 (19:48 -0600)
committerDavid Levine <levinedl@acm.org>
Fri, 21 Nov 2014 02:23:10 +0000 (20:23 -0600)
commit 5be8db81.

uip/mhoutsbr.c
uip/mhparse.c

index ca1acf8..0c0a297 100644 (file)
@@ -407,6 +407,7 @@ three_print:
        putc ('\n', out);
 
     (*ct->c_ceclosefnx) (ct);
+    free (bufp);
     return OK;
 }
 
index 0ec7712..7851e18 100644 (file)
@@ -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;
                }
            }