Signed-off-by: Wei Liu <wei.l...@citrix.com>
---
Cc: dave.sc...@eu.citrix.com

Please check if the use of caml_failwith is correct.
---
 tools/ocaml/libs/xl/xenlight_stubs.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/tools/ocaml/libs/xl/xenlight_stubs.c 
b/tools/ocaml/libs/xl/xenlight_stubs.c
index 7b8d6db..dccd7ed 100644
--- a/tools/ocaml/libs/xl/xenlight_stubs.c
+++ b/tools/ocaml/libs/xl/xenlight_stubs.c
@@ -780,6 +780,10 @@ value stub_xl_device_disk_of_vdev(value ctx, value domid, 
value vdev)
 
        c_vdev = strdup(String_val(vdev));
 
+       if (!c_vdev) {
+               caml_failwith("Failed to duplicate vdev string.");
+       }
+
        caml_enter_blocking_section();
        libxl_vdev_to_device_disk(CTX, c_domid, c_vdev, &c_disk);
        caml_leave_blocking_section();
-- 
1.9.1


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

Reply via email to