提交 f250a07b 编写于 作者: S stesen

fix malloc return judgment

Signed-off-by: Nstesen <stesen.ma@huawei.com>
Change-Id: Icbd605293c7045d6b53950fb15208bb0b6f3d37c
上级 f109aa24
......@@ -63,11 +63,11 @@ static char* get_native_hook_param()
}
const char *key = MUSL_HOOK_PARAM_NAME;
char *value = (char *)malloc(OHOS_PARAM_MAX_SIZE);
memset(value, 0, OHOS_PARAM_MAX_SIZE);
if (value == NULL) {
dlclose(shared_library_handle);
return NULL;
}
memset(value, 0, OHOS_PARAM_MAX_SIZE);
unsigned int len = OHOS_PARAM_MAX_SIZE;
getFunction(key, value, &len);
dlclose(shared_library_handle);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册