aboutsummaryrefslogtreecommitdiff
path: root/lib/formdata.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/formdata.c')
-rw-r--r--lib/formdata.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/lib/formdata.c b/lib/formdata.c
index 673759de9..13901b330 100644
--- a/lib/formdata.c
+++ b/lib/formdata.c
@@ -863,13 +863,6 @@ static CURLcode AddFormData(struct FormData **formp,
newform->type = type;
- if(*formp) {
- (*formp)->next = newform;
- *formp = newform;
- }
- else
- *formp = newform;
-
if(size) {
if(type != FORM_FILE)
/* for static content as well as callback data we add the size given
@@ -889,6 +882,14 @@ static CURLcode AddFormData(struct FormData **formp,
}
}
}
+
+ if(*formp) {
+ (*formp)->next = newform;
+ *formp = newform;
+ }
+ else
+ *formp = newform;
+
return CURLE_OK;
error:
if(newform)