[libvirt PATCH] esx: generator: fix free of elements in lists
mkletzan at redhat.com
Thu Sep 10 12:27:18 UTC 2020
On Thu, Sep 10, 2020 at 01:44:34PM +0200, Pino Toscano wrote:
>When a list is freed, we iterate through all the items, invoking the
>free function for each; the actual free function called for each element
>is the function of the actual type of each element, and thus the @_next
>pointer in the element struct has the same type as the element itself.
>Currently, the free function gets the parent of the current element
>type, and invoke its free function to continue freeing the list.
>However, in case the hierarchy of the classes has more than 1 level
>(i.e. Class <- SubClass <- SubSubClass), the invoked free function is
>only the parent class' one, and not the actual base class of the
>To fix that, change the generator to get the ancestor of a class, and
>invoking that instead. Also, avoid to set the @_next back, as it is not
I would say "base class" except "ancestor" because the naming confused me, but
other than that it looks good to me.
Reviewed-by: Martin Kletzander <mkletzan at redhat.com>
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 833 bytes
Desc: not available
More information about the libvir-list