]> granicus.if.org Git - curl/commitdiff
mark a value as alloced when strdup()ed to prevent memory leaks
authorDaniel Stenberg <daniel@haxx.se>
Thu, 13 May 2004 14:13:12 +0000 (14:13 +0000)
committerDaniel Stenberg <daniel@haxx.se>
Thu, 13 May 2004 14:13:12 +0000 (14:13 +0000)
lib/formdata.c

index 80941655a75ef23411b97f87a759e1d0b83a2866..671697acac7fc5ebe43d1aca46b28f24371e9240 100644 (file)
@@ -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;