mirror of
https://github.com/moparisthebest/curl
synced 2024-12-21 23:58:49 -05:00
added curl_formfree()
This commit is contained in:
parent
57ddd7e928
commit
c0936824d4
@ -382,8 +382,8 @@ char *MakeFormBoundary(void)
|
|||||||
|
|
||||||
return retstring;
|
return retstring;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* Used from http.c */
|
||||||
void FormFree(struct FormData *form)
|
void FormFree(struct FormData *form)
|
||||||
{
|
{
|
||||||
struct FormData *next;
|
struct FormData *next;
|
||||||
@ -391,6 +391,28 @@ void FormFree(struct FormData *form)
|
|||||||
next=form->next; /* the following form line */
|
next=form->next; /* the following form line */
|
||||||
free(form->line); /* free the line */
|
free(form->line); /* free the line */
|
||||||
free(form); /* free the struct */
|
free(form); /* free the struct */
|
||||||
|
|
||||||
|
} while((form=next)); /* continue */
|
||||||
|
}
|
||||||
|
|
||||||
|
/* external function to free up a whole form post chain */
|
||||||
|
void curl_formfree(struct HttpPost *form)
|
||||||
|
{
|
||||||
|
struct HttpPost *next;
|
||||||
|
do {
|
||||||
|
next=form->next; /* the following form line */
|
||||||
|
|
||||||
|
/* recurse to sub-contents */
|
||||||
|
if(form->more)
|
||||||
|
curl_formfree(form->more);
|
||||||
|
|
||||||
|
if(form->name)
|
||||||
|
free(form->name); /* free the name */
|
||||||
|
if(form->contents)
|
||||||
|
free(form->contents); /* free the contents */
|
||||||
|
if(form->contenttype)
|
||||||
|
free(form->contenttype); /* free the content type */
|
||||||
|
free(form); /* free the struct */
|
||||||
|
|
||||||
} while((form=next)); /* continue */
|
} while((form=next)); /* continue */
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user