virSecurityManagerNewStack: Don't ignore virSecurityStackAddNested retval

The virSecurityStackAddNested() can fail in which case
virSecurityManagerNewStack() should fail too.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
This commit is contained in:
Michal Privoznik 2018-08-21 14:54:52 +02:00
parent c060e400d9
commit 549ac3d142

View File

@ -117,9 +117,13 @@ virSecurityManagerNewStack(virSecurityManagerPtr primary)
if (!mgr)
return NULL;
virSecurityStackAddNested(mgr, primary);
if (virSecurityStackAddNested(mgr, primary) < 0)
goto error;
return mgr;
error:
virObjectUnref(mgr);
return NULL;
}