mirror of https://github.com/YosysHQ/yosys.git
macos: fix leak in proc_self_dirname()
This commit is contained in:
parent
081111714e
commit
b516c681fe
|
@ -797,7 +797,9 @@ std::string proc_self_dirname()
|
||||||
path = (char *) realloc((void *) path, buflen);
|
path = (char *) realloc((void *) path, buflen);
|
||||||
while (buflen > 0 && path[buflen-1] != '/')
|
while (buflen > 0 && path[buflen-1] != '/')
|
||||||
buflen--;
|
buflen--;
|
||||||
return std::string(path, buflen);
|
std::string str(path, buflen);
|
||||||
|
free(path);
|
||||||
|
return str;
|
||||||
}
|
}
|
||||||
#elif defined(_WIN32)
|
#elif defined(_WIN32)
|
||||||
std::string proc_self_dirname()
|
std::string proc_self_dirname()
|
||||||
|
|
Loading…
Reference in New Issue