From 6eabe29185ef2a33687e06de7696f9a2e1e49bf2 Mon Sep 17 00:00:00 2001 From: liutuantuan Date: Mon, 15 Jul 2024 21:07:38 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B0=86calloc=E5=87=BD=E6=95=B0=E6=94=B9?= =?UTF-8?q?=E6=88=90malloc=E5=87=BD=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: liutuantuan --- interfaces/inner_api/syscap_interface.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/interfaces/inner_api/syscap_interface.c b/interfaces/inner_api/syscap_interface.c index 10400be..862b1e4 100644 --- a/interfaces/inner_api/syscap_interface.c +++ b/interfaces/inner_api/syscap_interface.c @@ -130,7 +130,7 @@ bool EncodePrivateSyscap(char **output, int *outputLen) FreeContextBuffer(contextBuffer); return false; } - outputStr = (char *)calloc(priLen, sizeof(char)); + outputStr = (char *)malloc(priLen * sizeof(char)); if (outputStr == NULL) { PRINT_ERR("malloc buffer failed, size = %u, errno = %d\n", priLen, errno); *outputLen = 0;