mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-07 17:28:15 +00:00
libxl_conf: Resolve Coverity issue with call to regcomp()
This commit is contained in:
parent
0047d5d6e8
commit
50de0e0807
@ -769,10 +769,19 @@ error:
|
|||||||
virCapsPtr
|
virCapsPtr
|
||||||
libxlMakeCapabilities(libxl_ctx *ctx)
|
libxlMakeCapabilities(libxl_ctx *ctx)
|
||||||
{
|
{
|
||||||
|
int err;
|
||||||
libxl_physinfo phy_info;
|
libxl_physinfo phy_info;
|
||||||
const libxl_version_info *ver_info;
|
const libxl_version_info *ver_info;
|
||||||
|
|
||||||
regcomp(&xen_cap_rec, xen_cap_re, REG_EXTENDED);
|
err = regcomp(&xen_cap_rec, xen_cap_re, REG_EXTENDED);
|
||||||
|
if (err != 0) {
|
||||||
|
char error[100];
|
||||||
|
regerror(err, &xen_cap_rec, error, sizeof(error));
|
||||||
|
regfree(&xen_cap_rec);
|
||||||
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
|
_("Failed to compile regex %s"), error);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
if (libxl_get_physinfo(ctx, &phy_info) != 0) {
|
if (libxl_get_physinfo(ctx, &phy_info) != 0) {
|
||||||
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user