[libvirt] [PATCH 07/17] Fix failure to honour OOM status in qemuParseNBDString

Doug Goldstein cardoe at gentoo.org
Tue Sep 24 21:18:18 UTC 2013


On Tue, Sep 24, 2013 at 11:03 AM, Daniel P. Berrange
<berrange at redhat.com> wrote:
> From: "Daniel P. Berrange" <berrange at redhat.com>
>
> In qemuParseNBDString, if the virURIParse fails, the
> error is not reported to the caller. Instead execution
> falls through to the non-URI codepath causing memory
> leaks later on.
>
> Signed-off-by: Daniel P. Berrange <berrange at redhat.com>
> ---
>  src/qemu/qemu_command.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
> index bf07bdc..e0fd38e 100644
> --- a/src/qemu/qemu_command.c
> +++ b/src/qemu/qemu_command.c
> @@ -3477,9 +3477,9 @@ qemuParseNBDString(virDomainDiskDefPtr disk)
>      virURIPtr uri = NULL;
>
>      if (strstr(disk->src, "://")) {
> -        uri = virURIParse(disk->src);
> -        if (uri)
> -            return qemuParseDriveURIString(disk, uri, "nbd");
> +        if (!(uri = virURIParse(disk->src)))
> +            return -1;
> +        return qemuParseDriveURIString(disk, uri, "nbd");
>      }
>
>      if (VIR_ALLOC(h) < 0)
> --
> 1.8.3.1
>
> --
> libvir-list mailing list
> libvir-list at redhat.com
> https://www.redhat.com/mailman/listinfo/libvir-list

ACK

-- 
Doug Goldstein




More information about the libvir-list mailing list