Re: [PATCH] conf: fix memory leak of class_id bitmap

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

 



On 03/28/2013 01:45 AM, Eric Blake wrote:
On 03/27/2013 09:35 AM, Guannan Ren wrote:
When libvirtd loads active network configs from network state directory,
it should release the class_id memory block which was allocated
at the time of loading xml from network config directory.
virBitmapParse will create a new memory block of bitmap class_id which
causes a memory leak.

This happens when at least one virtual network is active before.

          class_id = virXPathString("string(./class_id[1]/@bitmap)", ctxt);
-        if (class_id &&
-            virBitmapParse(class_id, 0,
+        if (class_id) {
+            virBitmapFree(net->class_id);
+            if (virBitmapParse(class_id, 0,
                             &net->class_id, CLASS_ID_BITMAP_SIZE) < 0) {
Indentation is off on this line as a result.

ACK, and worth pushing for 1.0.4.


    Pushed with indentation fixed.
    Thanks for the review

    Guannan

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]