From: Bastian Dehn Date: Sat, 23 Mar 2024 07:57:24 +0000 (+0100) Subject: change response allocate all at once X-Git-Tag: v1.0.0^2~70^2~4 X-Git-Url: https://gitweb.hhaalo.de/?a=commitdiff_plain;h=0b0deaf21b6d77e64a863df2386990404f89616f;p=sane-kds-s2000w-net.git change response allocate all at once --- diff --git a/src/kds_s2000w_client.c b/src/kds_s2000w_client.c index f420854..e18411a 100644 --- a/src/kds_s2000w_client.c +++ b/src/kds_s2000w_client.c @@ -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;