mirror of
https://gitee.com/openharmony/communication_dsoftbus
synced 2024-12-20 00:21:45 +00:00
解决cJSON内存泄露的问题
Signed-off-by: y500286920 <yangliu158@huawei.com>
This commit is contained in:
parent
057807ee4b
commit
0cfb35e143
@ -97,8 +97,10 @@ int32_t TransAuthChannelErrorPack(int32_t errcode, const char *errMsg, char *cJs
|
|||||||
}
|
}
|
||||||
if (memcpy_s(cJsonStr, ERR_MSG_MAX_LEN, data, strlen(data)) != EOK) {
|
if (memcpy_s(cJsonStr, ERR_MSG_MAX_LEN, data, strlen(data)) != EOK) {
|
||||||
cJSON_Delete(obj);
|
cJSON_Delete(obj);
|
||||||
|
cJSON_free(data);
|
||||||
return SOFTBUS_MEM_ERR;
|
return SOFTBUS_MEM_ERR;
|
||||||
}
|
}
|
||||||
cJSON_Delete(obj);
|
cJSON_Delete(obj);
|
||||||
|
cJSON_free(data);
|
||||||
return SOFTBUS_OK;
|
return SOFTBUS_OK;
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user