On Fri, Sep 21, 2018 at 11:29 AM +0200, Michal Privoznik <mprivozn(a)redhat.com>
wrote:
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(a)redhat.com>
---
[…snip…]
diff --git a/src/security/security_selinux.c
b/src/security/security_selinux.c
index 056637e4cb..31e42afee7 100644
--- a/src/security/security_selinux.c
+++ b/src/security/security_selinux.c
@@ -156,6 +156,7 @@ virSecuritySELinuxContextListFree(void *opaque)
for (i = 0; i < list->nItems; i++)
virSecuritySELinuxContextItemFree(list->items[i]);
BTW, isn’t here VIR_FREE(list->items); missing? (see your commit
ca250269b0af24b319989807ee50f2a87b421922).
+ virObjectUnref(list->manager);
VIR_FREE(list);
}
@@ -1054,12 +1055,12 @@ virSecuritySELinuxTransactionStart(virSecurityManagerPtr mgr)
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;
}
--
2.16.4
--
libvir-list mailing list
libvir-list(a)redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Reviewed-by: Marc Hartmayer <mhartmay(a)linux.ibm.com>
--
Kind regards / Beste Grüße
Marc Hartmayer
IBM Deutschland Research & Development GmbH
Vorsitzende des Aufsichtsrats: Martina Koederitz
Geschäftsführung: Dirk Wittkopp
Sitz der Gesellschaft: Böblingen
Registergericht: Amtsgericht Stuttgart, HRB 243294