locate_core leaks memory
Describe the bug
locate_core
leaks memory returned from search_core
.
If the envvar "CMUCLCORE" isn't set, we call search_core
to find the
name of the core file, which is returned as a newly allocated string.
However, if the core isn't readable, we set core to NULL, leaking the
memory allocated by search_core
.
This isn't terrible. locate_core
is only called at most twice and
only at start up to find the core file.
To Reproduce
Expected behavior
We shouldn't leak memory.
Desktop (please complete the following information):
- OS: All
Additional Info
See #306, which is how we found this leak.