projects
/
yosys.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0811117
)
macos: fix leak in proc_self_dirname()
author
Zachary Snow
<zach@zachjs.com>
Mon, 14 Jun 2021 15:59:01 +0000
(11:59 -0400)
committer
Zachary Snow
<zachary.j.snow@gmail.com>
Mon, 14 Jun 2021 16:33:26 +0000
(12:33 -0400)
kernel/yosys.cc
patch
|
blob
|
history
diff --git
a/kernel/yosys.cc
b/kernel/yosys.cc
index efc429529158833292ab47f4eea0ad3aa47f2631..cb6fdc2f49dbc2d18fefa3a41c90422f0afd30d3 100644
(file)
--- a/
kernel/yosys.cc
+++ b/
kernel/yosys.cc
@@
-797,7
+797,9
@@
std::string proc_self_dirname()
path = (char *) realloc((void *) path, buflen);
while (buflen > 0 && path[buflen-1] != '/')
buflen--;
- return std::string(path, buflen);
+ std::string str(path, buflen);
+ free(path);
+ return str;
}
#elif defined(_WIN32)
std::string proc_self_dirname()