diff options
author | Stefano Stabellini <sstabellini@kernel.org> | 2017-05-09 12:04:51 -0700 |
---|---|---|
committer | Stefano Stabellini <sstabellini@kernel.org> | 2017-05-16 11:50:30 -0700 |
commit | c0c24b95542bc1a4dc3fc6ea71475ae04fa69189 (patch) | |
tree | 3abf317e580ac89c59a4e78f79cb0bfbbfc195df /hw/9pfs | |
parent | d9506cab36391c906671b3767d0ccf9c8c0e9645 (diff) | |
download | qemu-c0c24b95542bc1a4dc3fc6ea71475ae04fa69189.zip qemu-c0c24b95542bc1a4dc3fc6ea71475ae04fa69189.tar.gz qemu-c0c24b95542bc1a4dc3fc6ea71475ae04fa69189.tar.bz2 |
xen/9pfs: fix two resource leaks on error paths, discovered by Coverity
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
Diffstat (limited to 'hw/9pfs')
-rw-r--r-- | hw/9pfs/xen-9p-backend.c | 2 |
1 files changed, 2 insertions, 0 deletions
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); |