From: Bastian Dehn Date: Sun, 5 Jan 2025 09:43:38 +0000 (+0100) Subject: not json parse config by error X-Git-Tag: v1.0.24^2~11 X-Git-Url: https://gitweb.hhaalo.de/?a=commitdiff_plain;h=ded1fc978e437cb05a9e48f79e470fe904fe93d2;p=sane-kds-s2000w-net.git not json parse config by error --- diff --git a/src/kds_s2000w_handler_opts.c b/src/kds_s2000w_handler_opts.c index a5be246..b1a53f4 100644 --- a/src/kds_s2000w_handler_opts.c +++ b/src/kds_s2000w_handler_opts.c @@ -40,17 +40,16 @@ void _load_options(handler* h) response* resp = kds_s2000w_client_response_init(); int result = kds_s2000w_client_get_option(h->sessionid, resp); - h->current_scanner_config = json_tokener_parse(resp->data); if (result != 0 || resp->code != 200) { debug_printf_int(ERROR, "load options response code", resp->code); kds_s2000w_client_response_free(resp); resp = NULL; - json_object_put(h->current_scanner_config); - h->current_scanner_config = NULL; return; } + h->current_scanner_config = json_tokener_parse(resp->data); + kds_s2000w_client_response_free(resp); resp = NULL; }