mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
Fix leak of serial value in xenFormatXM on OOM
If an OOM occurs in xenFormatXM when formatting to the serial device value, the value is leaked. Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
This commit is contained in:
parent
760b59e909
commit
0377238fe8
@ -1959,9 +1959,11 @@ virConfPtr xenFormatXM(virConnectPtr conn,
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (xenFormatXMSerial(serialVal, chr) < 0)
|
if (xenFormatXMSerial(serialVal, chr) < 0) {
|
||||||
|
virConfFreeValue(serialVal);
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (serialVal->list != NULL) {
|
if (serialVal->list != NULL) {
|
||||||
int ret = virConfSetValue(conf, "serial", serialVal);
|
int ret = virConfSetValue(conf, "serial", serialVal);
|
||||||
|
Loading…
Reference in New Issue
Block a user