All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefano Stabellini <sstabellini@kernel.org>
To: peter.maydell@linaro.org, stefanha@gmail.com
Cc: sstabellini@kernel.org, stefanha@redhat.com,
	anthony.perard@citrix.com, xen-devel@lists.xenproject.org,
	qemu-devel@nongnu.org, groug@kaod.org,
	aneesh.kumar@linux.vnet.ibm.com
Subject: [Qemu-devel] [PULL 3/4] xen/9pfs: fix two resource leaks on error paths, discovered by Coverity
Date: Tue, 16 May 2017 12:21:51 -0700	[thread overview]
Message-ID: <1494962512-4831-3-git-send-email-sstabellini@kernel.org> (raw)
In-Reply-To: <1494962512-4831-1-git-send-email-sstabellini@kernel.org>

CID: 1374836

Signed-off-by: Stefano Stabellini <sstabellini@kernel.org>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Greg Kurz <groug@kaod.org>
CC: anthony.perard@citrix.com
CC: groug@kaod.org
CC: aneesh.kumar@linux.vnet.ibm.com
---
 hw/9pfs/xen-9p-backend.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/hw/9pfs/xen-9p-backend.c b/hw/9pfs/xen-9p-backend.c
index 9c7f41a..a1fdede 100644
--- a/hw/9pfs/xen-9p-backend.c
+++ b/hw/9pfs/xen-9p-backend.c
@@ -332,12 +332,14 @@ static int xen_9pfs_connect(struct XenDevice *xendev)
         str = g_strdup_printf("ring-ref%u", i);
         if (xenstore_read_fe_int(&xen_9pdev->xendev, str,
                                  &xen_9pdev->rings[i].ref) == -1) {
+            g_free(str);
             goto out;
         }
         g_free(str);
         str = g_strdup_printf("event-channel-%u", i);
         if (xenstore_read_fe_int(&xen_9pdev->xendev, str,
                                  &xen_9pdev->rings[i].evtchn) == -1) {
+            g_free(str);
             goto out;
         }
         g_free(str);
-- 
1.9.1

WARNING: multiple messages have this Message-ID (diff)
From: Stefano Stabellini <sstabellini@kernel.org>
To: peter.maydell@linaro.org, stefanha@gmail.com
Cc: sstabellini@kernel.org, qemu-devel@nongnu.org, groug@kaod.org,
	aneesh.kumar@linux.vnet.ibm.com, stefanha@redhat.com,
	anthony.perard@citrix.com, xen-devel@lists.xenproject.org
Subject: [PULL 3/4] xen/9pfs: fix two resource leaks on error paths, discovered by Coverity
Date: Tue, 16 May 2017 12:21:51 -0700	[thread overview]
Message-ID: <1494962512-4831-3-git-send-email-sstabellini@kernel.org> (raw)
In-Reply-To: <1494962512-4831-1-git-send-email-sstabellini@kernel.org>

CID: 1374836

Signed-off-by: Stefano Stabellini <sstabellini@kernel.org>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Greg Kurz <groug@kaod.org>
CC: anthony.perard@citrix.com
CC: groug@kaod.org
CC: aneesh.kumar@linux.vnet.ibm.com
---
 hw/9pfs/xen-9p-backend.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/hw/9pfs/xen-9p-backend.c b/hw/9pfs/xen-9p-backend.c
index 9c7f41a..a1fdede 100644
--- a/hw/9pfs/xen-9p-backend.c
+++ b/hw/9pfs/xen-9p-backend.c
@@ -332,12 +332,14 @@ static int xen_9pfs_connect(struct XenDevice *xendev)
         str = g_strdup_printf("ring-ref%u", i);
         if (xenstore_read_fe_int(&xen_9pdev->xendev, str,
                                  &xen_9pdev->rings[i].ref) == -1) {
+            g_free(str);
             goto out;
         }
         g_free(str);
         str = g_strdup_printf("event-channel-%u", i);
         if (xenstore_read_fe_int(&xen_9pdev->xendev, str,
                                  &xen_9pdev->rings[i].evtchn) == -1) {
+            g_free(str);
             goto out;
         }
         g_free(str);
-- 
1.9.1


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

  parent reply	other threads:[~2017-05-16 19:22 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-16 19:19 [Qemu-devel] [PULL 0/4] please pull xen-20170516-tag Stefano Stabellini
2017-05-16 19:19 ` Stefano Stabellini
2017-05-16 19:21 ` [Qemu-devel] [PULL 1/4] xen/mapcache: store dma information in revmapcache entries for debugging Stefano Stabellini
2017-05-16 19:21   ` Stefano Stabellini
2017-05-16 19:21   ` [Qemu-devel] [PULL 2/4] configure: Remove -lxencall for Xen detection Stefano Stabellini
2017-05-16 19:21     ` Stefano Stabellini
2017-05-16 19:21   ` Stefano Stabellini [this message]
2017-05-16 19:21     ` [PULL 3/4] xen/9pfs: fix two resource leaks on error paths, discovered by Coverity Stefano Stabellini
2017-05-16 19:21   ` [Qemu-devel] [PULL 4/4] xen: call qemu_set_cloexec instead of fcntl Stefano Stabellini
2017-05-16 19:21     ` Stefano Stabellini
2017-05-17 13:04 ` [Qemu-devel] [PULL 0/4] please pull xen-20170516-tag Stefan Hajnoczi
2017-05-17 13:04   ` Stefan Hajnoczi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1494962512-4831-3-git-send-email-sstabellini@kernel.org \
    --to=sstabellini@kernel.org \
    --cc=aneesh.kumar@linux.vnet.ibm.com \
    --cc=anthony.perard@citrix.com \
    --cc=groug@kaod.org \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@gmail.com \
    --cc=stefanha@redhat.com \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.