diff options
author | Matthew Daley <mattjd@gmail.com> | 2013-09-18 15:37:41 +1200 |
---|---|---|
committer | Ian Campbell <ian.campbell@citrix.com> | 2013-09-25 12:44:24 +0100 |
commit | 736491d1558dc97be4b8fac8957f3b5c7c0254f6 (patch) | |
tree | 02605931a7129451b1f2433c035c265bd8443126 /tools | |
parent | b0be2b126ea75a83a3778b4e1710d248f92cf528 (diff) | |
download | xen-736491d1558dc97be4b8fac8957f3b5c7c0254f6.tar.gz xen-736491d1558dc97be4b8fac8957f3b5c7c0254f6.tar.bz2 xen-736491d1558dc97be4b8fac8957f3b5c7c0254f6.zip |
libxl: fix dispose without init of disk in cd_insert
Coverity-ID: 1056078
Signed-off-by: Matthew Daley <mattjd@gmail.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/libxl/xl_cmdimpl.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c index 3d7eaad5e0..a609b98b0f 100644 --- a/tools/libxl/xl_cmdimpl.c +++ b/tools/libxl/xl_cmdimpl.c @@ -2529,18 +2529,16 @@ int main_memset(int argc, char **argv) static int cd_insert(uint32_t domid, const char *virtdev, char *phys) { - libxl_device_disk disk; /* we don't free disk's contents */ + libxl_device_disk disk; char *buf = NULL; XLU_Config *config = 0; struct stat b; int rc = 0; - if (asprintf(&buf, "vdev=%s,access=r,devtype=cdrom,target=%s", virtdev, phys ? phys : "") < 0) { fprintf(stderr, "out of memory\n"); - rc = 1; - goto out; + return 1; } parse_disk_config(&config, buf, &disk); |