mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-20 06:50:22 +03:00
conf: prevent NULL pointer access in virSecurityLabelDefsParseXML
When checking for seclabels without security models, def->nseclabels is already set to n. In the case of an error def->seclabels is freed but nseclabels is left untouched. This leads to a segmentation fault when def is freed in virDomainDefParseXML.
This commit is contained in:
parent
661d7fb4fc
commit
1fe6d219cb
@ -3179,6 +3179,7 @@ error:
|
||||
virSecurityLabelDefFree(def->seclabels[i - 1]);
|
||||
}
|
||||
VIR_FREE(def->seclabels);
|
||||
def->nseclabels = 0;
|
||||
VIR_FREE(list);
|
||||
return -1;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user