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

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



Hello,

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(...) {
    ...
    LIBVIRT_BEGIN_ALLOW_THREADS;
    c_retval = virDomainGetXMLDesc(domain, flags);
    LIBVIRT_END_ALLOW_THREADS;
    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?
-- 
Jun'ichi Nomura, NEC Corporation


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