Skip to content

Commit

Permalink
mgmt: hawkbit: move to zephyr heap functions
Browse files Browse the repository at this point in the history
maove to zephyr specific heap functions.

Signed-off-by: Fin Maaß <[email protected]>
  • Loading branch information
maass-hamburg committed Jun 5, 2024
1 parent 5faedd0 commit 8754d8c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions subsys/mgmt/hawkbit/hawkbit.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down Expand Up @@ -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;
Expand All @@ -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);
}

/*
Expand Down

0 comments on commit 8754d8c

Please sign in to comment.