]> xenbits.xensource.com Git - xen.git/commitdiff
libxl: avoid leaking in libxl__initiate_device_remove
authorWei Liu <wei.liu2@citrix.com>
Tue, 14 Jul 2015 16:41:07 +0000 (17:41 +0100)
committerIan Campbell <ian.campbell@citrix.com>
Wed, 15 Jul 2015 09:57:01 +0000 (10:57 +0100)
Change "return" to "goto out_success" to correctly dispose of the
structure.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
tools/libxl/libxl_device.c

index 24939724249a8e77eb49d9426540b72af7c72ff2..bee5ed564b04f1ca3d4a9e5e1e783f61561acefc 100644 (file)
@@ -816,7 +816,7 @@ void libxl__initiate_device_remove(libxl__egc *egc,
                            be_path);
                 goto out;
             }
-            return;
+            goto out_success;
         }
     }
 
@@ -868,6 +868,7 @@ void libxl__initiate_device_remove(libxl__egc *egc,
         goto out;
     }
 
+out_success:
     libxl_dominfo_dispose(&info);
     return;