[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [libvirt] libvirt-python: memory leak after GetXMLDesc?

On 12.09.2014 08:56, Junichi Nomura wrote:

I've observed memory leak in long-running python program and
suspects a bug in libvirt-python.

libvirt-python contains auto-generated code like this:

   libvirt_virDomainGetXMLDesc(...) {
     c_retval = virDomainGetXMLDesc(domain, flags);
     py_retval = libvirt_charPtrWrap((char *) c_retval);
     return py_retval;

virDomainGetXMLDesc() expects the caller to free c_retval.

Though it used to be freed in libvirt_charPtrWrap(), commit bb3301ba
("Don't free passed in args in libvirt_charPtrWrap /
libvirt_charPtrSizeWrap") has moved the responsibility to the outside.

So, it seems either GetXMLDesc should not depend on auto-generation or
the generator should be fixed.

Any comments?

Yes, this is a libvirt-python bug. And it's there since 1.2.1! We need to fix our generator. Patch on way.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]