From 8754d8c2b25e38ab042f0339a2fa62561fb1b5da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fin=20Maa=C3=9F?= Date: Tue, 14 May 2024 09:08:36 +0200 Subject: [PATCH] mgmt: hawkbit: move to zephyr heap functions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit maove to zephyr specific heap functions. Signed-off-by: Fin Maaß --- subsys/mgmt/hawkbit/hawkbit.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/subsys/mgmt/hawkbit/hawkbit.c b/subsys/mgmt/hawkbit/hawkbit.c index b1405bf20b7b70d..dabdb3e3bba54b5 100644 --- a/subsys/mgmt/hawkbit/hawkbit.c +++ b/subsys/mgmt/hawkbit/hawkbit.c @@ -894,7 +894,7 @@ static void response_cb(struct http_response *rsp, enum http_final_call final_da hb_context->response_buffer_size) { hb_context->response_buffer_size = hb_context->dl.downloaded_size + body_len; - rsp_tmp = realloc(hb_context->response_data, + rsp_tmp = k_realloc(hb_context->response_data, hb_context->response_buffer_size); if (rsp_tmp == NULL) { LOG_ERR("Failed to realloc memory"); @@ -1175,7 +1175,7 @@ static void s_http_start(void *o) s->hb_context.response_buffer_size = RESPONSE_BUFFER_SIZE; - s->hb_context.response_data = calloc(s->hb_context.response_buffer_size, sizeof(uint8_t)); + s->hb_context.response_data = k_calloc(s->hb_context.response_buffer_size, sizeof(uint8_t)); if (s->hb_context.response_data == NULL) { cleanup_connection(&s->hb_context.sock); s->hb_context.code_status = HAWKBIT_ALLOC_ERROR; @@ -1188,7 +1188,7 @@ static void s_http_end(void *o) struct s_object *s = (struct s_object *)o; cleanup_connection(&s->hb_context.sock); - free(s->hb_context.response_data); + k_free(s->hb_context.response_data); } /*