提交 7a9db21e 编写于 作者: H hhj

fix bug of using uninited mem

Signed-off-by: Nhhj <huanghuijin@huawei.com>
上级 ec3e2459
......@@ -2456,10 +2456,10 @@ int dlns_create(Dl_namespace *ns,const char *search_path)
sys_length += search_length;
}
new_path = malloc(sys_length + 1);
new_path = (char *)malloc(sys_length + 1);
if (!new_path) return ENOMEM;
strcat(new_path, sys_path);
strcpy(new_path, sys_path);
if (search_path[0] != ':') {
strcat(new_path, ":");
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册