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

[Xen-devel] [PATCH v2 28/30] libxl: ocaml: in send_debug_keys, clean up before raising exception



Signed-off-by: Rob Hoes <rob.hoes@xxxxxxxxxx>
---
 tools/ocaml/libs/xl/xenlight_stubs.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/ocaml/libs/xl/xenlight_stubs.c 
b/tools/ocaml/libs/xl/xenlight_stubs.c
index aab3b21..084961a 100644
--- a/tools/ocaml/libs/xl/xenlight_stubs.c
+++ b/tools/ocaml/libs/xl/xenlight_stubs.c
@@ -981,11 +981,11 @@ value stub_xl_send_debug_keys(value ctx, value keys)
        c_keys = dup_String_val(keys);
 
        ret = libxl_send_debug_keys(CTX, c_keys);
+       free(c_keys);
+
        if (ret != 0)
                failwith_xl(ret, "send_debug_keys");
 
-       free(c_keys);
-
        CAMLreturn(Val_unit);
 }
 
-- 
1.7.10.4


_______________________________________________
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®.