aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/formdata.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/formdata.c b/lib/formdata.c
index bdca3e770..e307a28a5 100644
--- a/lib/formdata.c
+++ b/lib/formdata.c
@@ -1110,8 +1110,10 @@ static CURLcode formdata_add_filename(const struct curl_httppost *file,
/* filename need be escaped */
filename_escaped = malloc(strlen(filename)*2+1);
- if(!filename_escaped)
+ if(!filename_escaped) {
+ free(filebasename);
return CURLE_OUT_OF_MEMORY;
+ }
p0 = filename_escaped;
p1 = filename;
while(*p1) {