dbuf_init(&path, 128);
dbuf_splitPath(module, &path, NULL);
- return dbuf_c_str(&path);
+ dbuf_c_str(&path);
+ return dbuf_detach(&path);
}
else
return NULL;
const char *
getBinPath(const char *prel)
{
- struct dbuf_s path;
const char *ret_path;
if (NULL != (ret_path = findProgramPath(prel)))
{
- dbuf_splitPath(prel, path, NULL);
+ struct dbuf_s path;
- free((void *)ret_path);
+ dbuf_init(&path, 128);
- return dbuf_c_str(path);
+ dbuf_splitPath(ret_path, &path, NULL);
+ free((void *)ret_path);
+ dbuf_c_str(&path);
+ return dbuf_detach(&path);
}
else
return NULL;