From 7bf26415fcba090e281324ba92f7d7e6487b94fc Mon Sep 17 00:00:00 2001 From: liuxu Date: Tue, 4 Jun 2024 16:30:19 +0800 Subject: [PATCH 100/108] bugfix:malloc right type size Signed-off-by: liuxu --- src/client/connect/rest/rest_volumes_client.c | 2 +- src/daemon/modules/service/service_network.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/client/connect/rest/rest_volumes_client.c b/src/client/connect/rest/rest_volumes_client.c index 88254e6c..2327c28e 100644 --- a/src/client/connect/rest/rest_volumes_client.c +++ b/src/client/connect/rest/rest_volumes_client.c @@ -251,7 +251,7 @@ static int prune_request_to_rest(const struct isula_prune_volume_request *reques parser_error err = NULL; int ret = 0; - nrequest = util_common_calloc_s(sizeof(volume_list_volume_request)); + nrequest = util_common_calloc_s(sizeof(volume_prune_volume_request)); if (nrequest == NULL) { ERROR("Out of memory"); return -1; diff --git a/src/daemon/modules/service/service_network.c b/src/daemon/modules/service/service_network.c index 6754cf1a..fe6dbf1d 100644 --- a/src/daemon/modules/service/service_network.c +++ b/src/daemon/modules/service/service_network.c @@ -74,7 +74,7 @@ static struct attach_net_conf_list *build_attach_networks(const defs_map_string_ return NULL; } - list = (struct attach_net_conf_list *)util_common_calloc_s(sizeof(struct attach_net_conf)); + list = (struct attach_net_conf_list *)util_common_calloc_s(sizeof(struct attach_net_conf_list)); if (list == NULL) { ERROR("Out of memory"); return NULL; -- 2.25.1