]> gitweb.hhaalo.de Git - sane-kds-s2000w-net.git/commitdiff
free response
authorBastian Dehn <hhaalo@arcor.de>
Sat, 27 Jan 2024 09:32:05 +0000 (10:32 +0100)
committerBastian Dehn <hhaalo@arcor.de>
Sat, 27 Jan 2024 09:32:05 +0000 (10:32 +0100)
src/kds_s2000w_handler.c

index 4c2ab9e5bdcb51dac41678a291504501d3376bed..fb25f6374b68505c1859cf1f0b8c9985f97e7cbc 100644 (file)
@@ -72,8 +72,13 @@ void kds_s2000w_handler_get_option(int option, void* value)
        json_object* resObj = json_tokener_parse(resp->data);
        json_object* config = json_object_object_get(resObj, "Configuration");
 
-       if (result != 0 || resp->code == 404)
+       if (result != 0 || resp->code == 404) {
+               kds_s2000w_client_response_free(resp);
+               resp = NULL;
+               json_object_put(resObj);
+               resObj = NULL;
                return;
+       }
 
        printf("DEBUG response: \n%s\n", resp->data);
        json_object* value_object = NULL;