Shunt around the file multipart stuff a bit to try and fix the segfault

This commit is contained in:
Daniel Silverstone 2014-01-04 20:53:43 +00:00
parent 581d877576
commit 2a18cef82b
1 changed files with 10 additions and 9 deletions

View File

@ -590,15 +590,7 @@ bool form_successful_controls(struct form *form,
success_new->value =
ENCODE_ITEM(control->value ?
control->value : "");
success_new->next = 0;
last_success->next = success_new;
last_success = success_new;
if (!success_new->name ||
!success_new->value) {
LOG(("strdup failed"));
goto no_memory;
}
success_new->rawfile = NULL;
/* Retrieve the filename from the DOM annotation */
if (dom_node_get_user_data(
control->node,
@ -621,6 +613,15 @@ bool form_successful_controls(struct form *form,
goto no_memory;
}
success_new->next = 0;
last_success->next = success_new;
last_success = success_new;
if (!success_new->name ||
!success_new->value) {
LOG(("strdup failed"));
goto no_memory;
}
continue;
break;