This shouldn't be needed per-se. Security manager shouldn't
disappear during transactions - it's immutable. However, it
doesn't hurt to grab a reference either - transaction code uses
it after all.
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
VIR_FREE(list->items[i]);
}
VIR_FREE(list->items);
+ virObjectUnref(list->manager);
VIR_FREE(list);
}
if (VIR_ALLOC(list) < 0)
return -1;
- list->manager = mgr;
+ list->manager = virObjectRef(mgr);
if (virThreadLocalSet(&chownList, list) < 0) {
virReportSystemError(errno, "%s",
_("Unable to set thread local variable"));
- VIR_FREE(list);
+ virSecurityDACChownListFree(list);
return -1;
}
virSecuritySELinuxContextItemFree(list->items[i]);
VIR_FREE(list->items);
+ virObjectUnref(list->manager);
VIR_FREE(list);
}
if (VIR_ALLOC(list) < 0)
return -1;
- list->manager = mgr;
+ list->manager = virObjectRef(mgr);
if (virThreadLocalSet(&contextList, list) < 0) {
virReportSystemError(errno, "%s",
_("Unable to set thread local variable"));
- VIR_FREE(list);
+ virSecuritySELinuxContextListFree(list);
return -1;
}