[libvirt] [PATCH 1/2] security: DAC: fix the transaction model's list append
Erik Skultety
eskultet at redhat.com
Tue Jan 17 14:55:09 UTC 2017
> > - if (VIR_APPEND_ELEMENT(list->items, list->nItems, item) < 0) {
> > - VIR_FREE(item);
> > - return -1;
> > - }
> > + if (VIR_APPEND_ELEMENT(list->items, list->nItems, item) < 0)
> > + goto cleanup;
> >
> > - return 0;
> > + tmp = NULL;
> > + item = NULL;
>
> This 'item = NULL' is not needed. VIR_APPEND_ELEMENT sets @item to NULL
> upon successful return. But I agree that it is hard to spot.
Oh, missed that one, thanks for the suggestion.
Erik
More information about the libvir-list
mailing list