sr99622 / libonvif

Onvif library with GUI implementation and built in YOLOX
GNU Lesser General Public License v2.1
175 stars 45 forks source link

Memory leaks #70

Open peakpeak-github opened 1 year ago

peakpeak-github commented 1 year ago

In onvif.c, line 1822 you return without freeing xmlXPathObjectPtr result, i.e xmlXPathFreeObject(result); is missing before the return, causing a memory leak.

sr99622 commented 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.

petterreinholdtsen commented 11 months ago

Did you use valgrind to discover these memory leaks?

sr99622 commented 11 months ago

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

petterreinholdtsen commented 11 months ago

[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