]> gitweb.hhaalo.de Git - sane-kds-s2000w-net.git/commitdiff
set old config recreate session with malloc
authorBastian Dehn <hhaalo@arcor.de>
Mon, 20 Oct 2025 18:51:36 +0000 (20:51 +0200)
committerBastian Dehn <hhaalo@arcor.de>
Mon, 20 Oct 2025 18:51:36 +0000 (20:51 +0200)
src/kds_s2000w_handler.c

index b0f36b9065d19bd3544fa0e183d56b0e81a4179a..cc463f57a107d23722355b7e572f8b10b8357c84 100644 (file)
@@ -296,7 +296,6 @@ void kds_s2000w_handler_recreate_session(handler_t* h)
        if (resp->code != 200) {
                kds_s2000w_client_response_free(resp);
                resp = NULL;
-
                return;
        }
 
@@ -314,7 +313,7 @@ void kds_s2000w_handler_recreate_session(handler_t* h)
        resp = kds_s2000w_client_response_init();
        resp->size = sizeof(char) * strlen(json_string);
        resp->code = 0;
-       resp->data = realloc(resp->data, resp->size);
+       resp->data = malloc(sizeof(char) * resp->size);
        resp->data = memcpy(resp->data, json_string, resp->size);
        kds_s2000w_client_set_option(h->sessionid, resp);