]> gitweb.hhaalo.de Git - sane-kds-s2000w-net.git/commitdiff
response malloc all at once
authorBastian Dehn <hhaalo@arcor.de>
Wed, 20 Mar 2024 14:49:19 +0000 (15:49 +0100)
committerBastian Dehn <hhaalo@arcor.de>
Wed, 20 Mar 2024 14:49:19 +0000 (15:49 +0100)
src/kds_s2000w_client.c

index 9170129d5f51142730ec03bd3b4d154f26bd9caf..c035ef53a9537ec2a24b047f6f33e4b68ce2a09c 100644 (file)
@@ -42,8 +42,7 @@ response* kds_s2000w_client_response_init()
        debug_printf(ALL, "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;