Patchwork [RFC,v2,08/17] qapi: fix Error usage in qemu-sockets.c

login
register
mail settings
Submitter Michael Roth
Date April 18, 2011, 3:02 p.m.
Message ID <1303138953-1334-9-git-send-email-mdroth@linux.vnet.ibm.com>
Download mbox | patch
Permalink /patch/91773/
State New
Headers show

Comments

Michael Roth - April 18, 2011, 3:02 p.m.
Fix spurious errors due to not initializing Error pointer to NULL before
checking for errors.

Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 qemu-sockets.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
Jes Sorensen - April 21, 2011, 8:20 a.m.
On 04/18/11 17:02, Michael Roth wrote:
> Fix spurious errors due to not initializing Error pointer to NULL before
> checking for errors.
> 
> Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
> ---
>  qemu-sockets.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/qemu-sockets.c b/qemu-sockets.c
> index dc8beeb..e709e5f 100644
> --- a/qemu-sockets.c
> +++ b/qemu-sockets.c
> @@ -630,7 +630,7 @@ int unix_connect(const char *path)
>  {
>      QemuOpts *opts;
>      int sock;
> -    Error *err;
> +    Error *err = NULL;
>  
>      opts = qemu_opts_create(&dummy_opts, NULL, 0, &err);
>      if (err) {

This one really should go into the tree asap, even if the rest of the
virt agent patches are still pending.

Reviewed-by: Jes Sorensen <Jes.Sorensen@redhat.com>

Patch

diff --git a/qemu-sockets.c b/qemu-sockets.c
index dc8beeb..e709e5f 100644
--- a/qemu-sockets.c
+++ b/qemu-sockets.c
@@ -630,7 +630,7 @@  int unix_connect(const char *path)
 {
     QemuOpts *opts;
     int sock;
-    Error *err;
+    Error *err = NULL;
 
     opts = qemu_opts_create(&dummy_opts, NULL, 0, &err);
     if (err) {