diff --git a/lib/formdata.c b/lib/formdata.c index 14d911d35ab8d7c283fcd4bce6071732c32adb64..cadccb802f2c08dfba7d429e33fd235c9cbb8786 100644 --- a/lib/formdata.c +++ b/lib/formdata.c @@ -371,6 +371,7 @@ char *Curl_FormBoundary(void) void Curl_FormFree(struct FormData *form) { struct FormData *next; + do { next=form->next; /* the following form line */ free(form->line); /* free the line */ @@ -383,6 +384,11 @@ void Curl_FormFree(struct FormData *form) void curl_formfree(struct HttpPost *form) { struct HttpPost *next; + + if(!form) + /* no form to free, just get out of this */ + return; + do { next=form->next; /* the following form line */