From ccdcdb2a461839c9fd7f3306e24bd4a7a818a892 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Thu, 13 May 2004 14:13:12 +0000 Subject: [PATCH] mark a value as alloced when strdup()ed to prevent memory leaks --- lib/formdata.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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;