diff options
author | Dan Fandrich <dan@coneharvesters.com> | 2008-11-18 19:58:44 +0000 |
---|---|---|
committer | Dan Fandrich <dan@coneharvesters.com> | 2008-11-18 19:58:44 +0000 |
commit | a028c69f48bb74e435d9313e152ce0b42ee351a8 (patch) | |
tree | 61b5b8b9d934f79517b33be5c9ab95880c6fcfcc /lib | |
parent | 4e4b6de5ce284c006782fd065390f4252cb58532 (diff) |
Avoid creating garbage on an OOM error
Diffstat (limited to 'lib')
-rw-r--r-- | lib/formdata.c | 5 |
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, |