]> gitweb.hhaalo.de Git - sane-kds-s2000w-net.git/commitdiff
change response allocate all at once
authorBastian Dehn <hhaalo@arcor.de>
Sat, 23 Mar 2024 07:57:24 +0000 (08:57 +0100)
committerBastian Dehn <hhaalo@arcor.de>
Sat, 23 Mar 2024 07:57:24 +0000 (08:57 +0100)
src/kds_s2000w_client.c

index f4208547bd26b80a7ac86f24f863dcad3dffbc91..e18411a4e2e6db7c10a0e543806e8cbc37bd0846 100644 (file)
@@ -43,8 +43,7 @@ response* kds_s2000w_client_response_init()
 
        response* resp = NULL;
 
-       resp = malloc(sizeof(response));
-       resp->data = malloc(sizeof(char));
+       resp = malloc(sizeof(response) + sizeof(char));
        resp->data = '\0';
        resp->size = 0;
        resp->code = 0L;