!318 释放内存

Merge pull request !318 from flying/master
This commit is contained in:
openharmony_ci
2023-09-27 07:42:57 +00:00
committed by Gitee
+3
View File
@@ -395,6 +395,7 @@ char *DecodeRpcidToStringFormat(const char *inputFile)
ret = sprintf_s(outBuffer, outBufferLen, "%u", outUint[0]);
if (ret == -1) {
PRINT_ERR("sprintf_s failed.\n");
free(outBuffer);
outBuffer = NULL;
goto FREE_MALLOC_PRISYSCAP;
}
@@ -402,6 +403,7 @@ char *DecodeRpcidToStringFormat(const char *inputFile)
ret = sprintf_s(outBuffer, outBufferLen, "%s,%u", outBuffer, outUint[i]);
if (ret == -1) {
PRINT_ERR("sprintf_s failed.\n");
free(outBuffer);
outBuffer = NULL;
goto FREE_MALLOC_PRISYSCAP;
}
@@ -412,6 +414,7 @@ char *DecodeRpcidToStringFormat(const char *inputFile)
priSyscapArray + i * SINGLE_SYSCAP_LEN);
if (ret == -1) {
PRINT_ERR("sprintf_s failed.\n");
free(outBuffer);
outBuffer = NULL;
goto FREE_MALLOC_PRISYSCAP;
}