From b2e3e417e78d2d7b0dfe18de5f74c95391a9f09b Mon Sep 17 00:00:00 2001 From: liutuantuan Date: Wed, 29 May 2024 17:06:24 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E5=8E=BB=E6=8E=89=E5=A4=9A=E4=BD=99?= =?UTF-8?q?=E7=9A=84=E7=BD=AE=E7=A9=BA=E6=93=8D=E4=BD=9C?= 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 | 4 ---- 1 file changed, 4 deletions(-) diff --git a/interfaces/inner_api/syscap_interface.c b/interfaces/inner_api/syscap_interface.c index c935297..c85b66a 100644 --- a/interfaces/inner_api/syscap_interface.c +++ b/interfaces/inner_api/syscap_interface.c @@ -516,10 +516,6 @@ char *DecodeRpcidToStringFormat(const char *inputFile) } PartSysCapAndOutBuffer(freeAfterDecodeRpcidInfo, outBuffer, priSyscapArray, sysCapArray); - - free(priSyscapArray); - priSyscapArray = NULL; - return FreeAfterDecodeRpcidToString(freeAfterDecodeRpcidInfo, FREE_MALLOC_PRISYSCAP_AFTER_DECODE_RPCID, outBuffer); } -- Gitee From 1984318484ae22ca65f2f4cd644a0e9c907cc423 Mon Sep 17 00:00:00 2001 From: liutuantuan Date: Wed, 29 May 2024 18:01:56 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E4=BF=AE=E6=94=B9bug=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: liutuantuan --- src/syscap_tool.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/syscap_tool.c b/src/syscap_tool.c index 5663b64..18414a2 100644 --- a/src/syscap_tool.c +++ b/src/syscap_tool.c @@ -182,7 +182,7 @@ int32_t RPCIDEncode(char *inputFile, char *outputPath) if (FillOsCapLength(convertedBuffer, contextBuffer, gJsonObjectSysCap, sysCapSize, ret) == -1) { return FreeAfterRPCIDEncode(gJsonObjectSysCap.cjsonObjectRoot, convertedBuffer, contextBuffer, - FREE_CONVERT_OUT_RPCID_ENCODE, ret); + FREE_CONVERT_OUT_RPCID_ENCODE, -1); } if (ConvertedContextSaveAsFile(outputPath, "rpcid.sc", convertedBuffer, convertedBufLen) != 0) { PRINT_ERR("ConvertedContextSaveAsFile failed, outputPath:%s, filename:rpcid.sc\n", outputPath); -- Gitee From e852cf5a51a5c2d3e38d938d76ef05dc1f46c589 Mon Sep 17 00:00:00 2001 From: liutuantuan Date: Wed, 29 May 2024 18:09:51 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E4=BF=AE=E6=94=B9RPCIDEncode=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: liutuantuan --- src/syscap_tool.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/syscap_tool.c b/src/syscap_tool.c index 18414a2..3bcd76a 100644 --- a/src/syscap_tool.c +++ b/src/syscap_tool.c @@ -141,10 +141,9 @@ int32_t RPCIDEncode(char *inputFile, char *outputPath) gJsonObjectSysCap.cjsonObjectRoot = NULL; gJsonObjectSysCap.sysCapPtr = NULL; - int32_t ret = GetFileContext(inputFile, &contextBuffer, &bufferLen); - if (ret != 0) { + if (GetFileContext(inputFile, &contextBuffer, &bufferLen) != 0) { PRINT_ERR("GetFileContext failed, input file : %s\n", inputFile); - return ret; + return -1; } gJsonObjectSysCap.cjsonObjectRoot = cJSON_ParseWithLength(contextBuffer, bufferLen); @@ -161,7 +160,7 @@ int32_t RPCIDEncode(char *inputFile, char *outputPath) FREE_CONTEXT_OUT_RPCID_ENCODE, -1); } - ret = cJSON_GetArraySize(gJsonObjectSysCap.sysCapPtr); + int32_t ret = cJSON_GetArraySize(gJsonObjectSysCap.sysCapPtr); if (ret < 0) { PRINT_ERR("get \"syscap\" array size failed\n"); return FreeAfterRPCIDEncode(gJsonObjectSysCap.cjsonObjectRoot, NULL, contextBuffer, @@ -184,7 +183,8 @@ int32_t RPCIDEncode(char *inputFile, char *outputPath) return FreeAfterRPCIDEncode(gJsonObjectSysCap.cjsonObjectRoot, convertedBuffer, contextBuffer, FREE_CONVERT_OUT_RPCID_ENCODE, -1); } - if (ConvertedContextSaveAsFile(outputPath, "rpcid.sc", convertedBuffer, convertedBufLen) != 0) { + ret = ConvertedContextSaveAsFile(outputPath, "rpcid.sc", convertedBuffer, convertedBufLen); + if (ret != 0) { PRINT_ERR("ConvertedContextSaveAsFile failed, outputPath:%s, filename:rpcid.sc\n", outputPath); } return FreeAfterRPCIDEncode(gJsonObjectSysCap.cjsonObjectRoot, convertedBuffer, contextBuffer, -- Gitee