]> gitweb.hhaalo.de Git - sane-kds-s2000w-net.git/commitdiff
not json parse config by error
authorBastian Dehn <hhaalo@arcor.de>
Sun, 5 Jan 2025 09:43:38 +0000 (10:43 +0100)
committerBastian Dehn <hhaalo@arcor.de>
Sun, 5 Jan 2025 09:43:38 +0000 (10:43 +0100)
src/kds_s2000w_handler_opts.c

index a5be246e3c4bf5a0d214a9c0454db81244969e99..b1a53f4d3285ec26797f064770c566108fed795a 100644 (file)
@@ -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;
 }