[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH for-4.6 13/13] tools/ocaml: handle strdup failure in stub_xl_device_disk_of_vdev



> On 23 Jul 2015, at 08:59, Wei Liu <wei.liu2@xxxxxxxxxx> wrote:
> 
> Signed-off-by: Wei Liu <wei.liu2@xxxxxxxxxx>
> ---
> Cc: dave.scott@xxxxxxxxxxxxx
> 
> Please check if the use of caml_failwith is correct.

This looks fine to me.

Acked-by: David Scott <dave.scott@xxxxxxxxxx>

> ---
> 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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.