Commit 53e3c225 authored by Daniel Stenberg's avatar Daniel Stenberg
Browse files

curl_formfree() can be called with a NULL argument

parent 50a53d4e
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -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 */