aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/formdata.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/formdata.c b/lib/formdata.c
index 483c9f82e..08ccf4db3 100644
--- a/lib/formdata.c
+++ b/lib/formdata.c
@@ -1211,8 +1211,11 @@ CURLcode Curl_getFormData(struct FormData **finalform,
char *filebasename= NULL;
if(!file->showfilename) {
filebasename = strippath(file->contents);
- if(!filebasename)
+ if(!filebasename) {
+ Curl_formclean(&firstform);
+ free(boundary);
return CURLE_OUT_OF_MEMORY;
+ }
}
result = AddFormDataf(&form, &size,