mirror of
https://github.com/netsurf-browser/netsurf
synced 2025-01-03 17:54:33 +03:00
form: Fix situation where a gadget initialises with NULL value
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
This commit is contained in:
parent
05c6ee02d9
commit
b15b204f49
@ -2269,8 +2269,12 @@ form_gadget_sync_with_dom(struct form_control *control)
|
||||
control->syncing = true;
|
||||
|
||||
/* If we've changed value, sync that toward the DOM */
|
||||
if ((control->last_synced_value == NULL && control->value[0] != '\0') ||
|
||||
(control->last_synced_value != NULL && strcmp(control->value, control->last_synced_value) != 0)) {
|
||||
if ((control->last_synced_value == NULL &&
|
||||
control->value != NULL &&
|
||||
control->value[0] != '\0') ||
|
||||
(control->last_synced_value != NULL &&
|
||||
control->value != NULL &&
|
||||
strcmp(control->value, control->last_synced_value) != 0)) {
|
||||
char *dup = strdup(control->value);
|
||||
if (dup == NULL) {
|
||||
goto out;
|
||||
|
Loading…
Reference in New Issue
Block a user