continue;
struct oc_form_opt *opt = calloc(1, sizeof(*opt));
- if (!opt)
+ if (!opt) {
+ nomem2:
+ free(opt);
goto nomem;
+ }
for (int j = 0; j < f->u.object.length; j++) {
json_value *subval = f->u.object.values[j].value;
subval->type = json_null, subval->u.string.ptr = NULL; /* XX */
} else if (!strcmp(subname, "caption") && subval->type == json_string) {
if (asprintf(&opt->label, "%s:", subval->u.string.ptr) < 0)
- goto nomem;
+ goto nomem2;
} else if (!strcmp(subname, "value") && subval->type == json_string && subval->u.string.length > 0) {
opt->_value = subval->u.string.ptr;
subval->type = json_null, subval->u.string.ptr = NULL; /* XX */