aboutsummaryrefslogtreecommitdiff
path: root/lib/formdata.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2004-05-13 14:13:12 +0000
committerDaniel Stenberg <daniel@haxx.se>2004-05-13 14:13:12 +0000
commitccdcdb2a461839c9fd7f3306e24bd4a7a818a892 (patch)
tree33a2a665fd864727df01c14758e3d07bfc439ec9 /lib/formdata.c
parentb121e41ec3ae3f5fe355d3802f4c3ddf0f50e190 (diff)
mark a value as alloced when strdup()ed to prevent memory leaks
Diffstat (limited to 'lib/formdata.c')
-rw-r--r--lib/formdata.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/formdata.c b/lib/formdata.c
index 80941655a..671697aca 100644
--- a/lib/formdata.c
+++ b/lib/formdata.c
@@ -492,8 +492,10 @@ CURLFORMcode FormAdd(struct curl_httppost **httppost,
current_form->value = strdup(filename);
if(!current_form->value)
return_value = CURL_FORMADD_MEMORY;
- else
+ else {
current_form->flags |= HTTPPOST_READFILE;
+ current_form->value_alloc = TRUE;
+ }
}
else
return_value = CURL_FORMADD_NULL;