Open peakpeak-github opened 1 year ago
You are correct that this will cause a memory leak, thank you for pointing this out. There are even a couple more similar conditions in lines 1868 and 1873. I am releasing a new version shortly, these fixes will be included.
Your feedback is greatly appreciated.
Did you use valgrind to discover these memory leaks?
Hi Petter,
It's nice to see your message, hope all is well. The leak can be seen from the code, there is a close command that should follow that was missed. These leaks are pretty small, so they wouldn't be noticed in most situations, but should be fixed.
I haven't used valgrind in the past, but it might be worth looking at.
Best Regards,
Stephen
[Stephen Rhodes]
It's nice to see your message, hope all is well.
Thanks. Hope you are dowing well too.
The leak can be seen from the code, there is a close command that should follow that was missed. These leaks are pretty small, so they wouldn't be noticed in most situations, but should be fixed.
Glad to hear a fix is easy to make. Hope the new version will make it to Debian soon. :)
I haven't used valgrind in the past, but it might be worth looking at.
It is one of the tools that single handedly improvided Linux software quality, so definitely worth a look. :)
A simple "valgrind onvif-gui" run show a few issues that might be worth investigating. :)
-- Happy hacking Petter Reinholdtsen
In onvif.c, line 1822 you return without freeing xmlXPathObjectPtr result, i.e xmlXPathFreeObject(result); is missing before the return, causing a memory leak.