[libvirt] using public vir*Free() (instead of virUnref*()) from vir*FreeName() destructors.

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

 



I just noticed in datatypes.c that the vir(Network|StoragePool|StorageVol)FreeName destructors call the public API vir*Free() functions rather than the local virUnref*(). vir*Free() all clear any errors, which seems like it might not be the right thing to do (eg, if we're cleaning out the hashtables as part of some error-handling path, and haven't yet logged the error).

On the other hand, the public API function does some sanity checking on the object to make sure it really is what we think it is before calling the unref. So it's got that going for it. (5 points to anyone who catches the reference without going to Google) But I don't know enough to know whether or not that's important in this case.

So which is more important: the extra sanity check, or not clearing existing error codes?

--
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]