Memory leak in sfs
Status: Alpha
Brought to you by:
henroid
Bug
---
The 'sfs' sample application in ptptl/samples/sfs has
a memory leak. Memory allocated in sfs.cpp on
line 1214: char *s = new char[23];
is not freed.
To verify the bug
-----------------
1. Add the following line to ptptl/Makefile.cfg
_DEBUG = 1
2. Recompile ptp and the samples. This injects the
debug library, allowing us to track invocations
of 'new' and 'delete'.
3. In ptptl/samples/sfs
./sfs
This brings you to the sfs prompt (sfs) where you
type in 'quit'. The Debug library produces a dump of
the memory leak at this point along with the cause of
the leak.
Fix
---
Replace line 1244
return 0;
with:
delete s;
return 0;