mirror of
https://github.com/openharmony/developtools_syscap_codec.git
synced 2026-08-27 02:11:19 -04:00
修改src/create_pcid.c文件,在GetOsSyscap函数中加入cJSON_Delete(capVectorPtr);
在GetOsSyscap函数中加入cJSON_Delete(capVectorPtr);,删除capVectorPtr变量 Signed-off-by: tongkai0808fh <tongkai5@huawei.com>
This commit is contained in:
@@ -332,6 +332,7 @@ int32_t GetOsSyscap(PCIDMain *pcidMain, cJSON *sysCapObject)
|
||||
}
|
||||
if (!cJSON_AddItemToArray(capVectorPtr, cJSON_CreateString(g_arraySyscap[j].str))) {
|
||||
printf("cJSON_AddItemToArray or cJSON_CreateString failed\n");
|
||||
cJSON_Delete(capVectorPtr);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
@@ -339,9 +340,11 @@ int32_t GetOsSyscap(PCIDMain *pcidMain, cJSON *sysCapObject)
|
||||
|
||||
if (!cJSON_AddItemToObject(sysCapObject, "os", capVectorPtr)) {
|
||||
PRINT_ERR("cJSON_AddItemToObject failed\n");
|
||||
cJSON_Delete(capVectorPtr);
|
||||
return -1;
|
||||
}
|
||||
|
||||
cJSON_Delete(capVectorPtr);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user