|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-devel] [PATCH for-4.6 13/13] tools/ocaml: handle strdup failure in stub_xl_device_disk_of_vdev
Signed-off-by: Wei Liu <wei.liu2@xxxxxxxxxx>
---
Cc: dave.scott@xxxxxxxxxxxxx
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@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |