mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-11 23:37:42 +00:00
conf: avoid memory leak on disk operations
Detected by Coverity. Leak on meta introduced in commit 85aa40e. * src/conf/domain_conf.c (virDomainDiskDefForeachPath): Plug leak.
This commit is contained in:
parent
ed246fbb79
commit
57ec8cedfc
@ -11315,7 +11315,7 @@ int virDomainDiskDefForeachPath(virDomainDiskDefPtr disk,
|
|||||||
virDomainDiskDefPathIterator iter,
|
virDomainDiskDefPathIterator iter,
|
||||||
void *opaque)
|
void *opaque)
|
||||||
{
|
{
|
||||||
virHashTablePtr paths;
|
virHashTablePtr paths = NULL;
|
||||||
int format;
|
int format;
|
||||||
int ret = -1;
|
int ret = -1;
|
||||||
size_t depth = 0;
|
size_t depth = 0;
|
||||||
@ -11339,7 +11339,7 @@ int virDomainDiskDefForeachPath(virDomainDiskDefPtr disk,
|
|||||||
virDomainReportError(VIR_ERR_INTERNAL_ERROR,
|
virDomainReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
_("unknown disk format '%s' for %s"),
|
_("unknown disk format '%s' for %s"),
|
||||||
disk->driverType, disk->src);
|
disk->driverType, disk->src);
|
||||||
return -1;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (allowProbing) {
|
if (allowProbing) {
|
||||||
@ -11348,7 +11348,7 @@ int virDomainDiskDefForeachPath(virDomainDiskDefPtr disk,
|
|||||||
virDomainReportError(VIR_ERR_INTERNAL_ERROR,
|
virDomainReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
_("no disk format for %s and probing is disabled"),
|
_("no disk format for %s and probing is disabled"),
|
||||||
disk->src);
|
disk->src);
|
||||||
return -1;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user