!487 [Bug] 使用cJSON_free释放内存

Merge pull request !487 from Luming/master
This commit is contained in:
openharmony_ci
2024-08-20 11:47:12 +00:00
committed by Gitee
3 changed files with 5 additions and 5 deletions
+2 -2
View File
@@ -26,7 +26,7 @@
#define PCID_MAIN_BYTES 128
#define PCID_MAIN_INTS 32
#define E_EORROR (-1)
#define E_ERROR (-1)
#define E_OK 0
#define E_APIVERSION 1
#define E_SYSCAP 2
@@ -54,7 +54,7 @@ char *DecodeRpcidToStringFormat(const char *inputFile);
* rpcidString, input string format rpcid.
* result, output comparison results.
* retval:
* E_EORROR, compare failed.
* E_ERROR, compare failed.
* E_OK, compare successful and meet the requirements.
* E_APIVERSION, compare successful but api version too low.
* E_SYSCAP, compare successful but missing some syscaps.
+1 -1
View File
@@ -759,7 +759,7 @@ int32_t DecodeStringPCIDToJson(char *input, char *outDirPath)
ret = 0;
FAILED:
SafeFree(jsonBuffer);
cJSON_free(jsonBuffer);
SafeFree(priSyscapStr);
cJSON_Delete(sysCapObj);
cJSON_Delete(rootObj);
+2 -2
View File
@@ -208,7 +208,7 @@ def _check_path_prefix(paths):
def traversal_files(subsystem_path, _files):
for item in os.scandir(subsystem_path):
if is_symlik(item.path):
if is_symlink(item.path):
continue
elif item.is_file() and item.name == 'ohos.build':
_files.append(item.path)
@@ -230,7 +230,7 @@ def get_file_type(file_path):
return 'unknown'
def is_symlik(file_path):
def is_symlink(file_path):
file_type = get_file_type(file_path)
if file_type == 'symlink':
link_target = os.readlink(file_path)