From: Rob Hoes Subject: [PATCH v3-RESEND 25/28] libxl: ocaml: in send_debug_keys, clean up before raising exception Date: Mon, 21 Oct 2013 14:32:42 +0100 Message-ID: <1382362365-6645-26-git-send-email-rob.hoes@citrix.com> References: <1382362365-6645-1-git-send-email-rob.hoes@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1382362365-6645-1-git-send-email-rob.hoes@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel@lists.xen.org Cc: ian.jackson@eu.citrix.com, ian.campbell@citrix.com, Rob Hoes List-Id: xen-devel@lists.xenproject.org Signed-off-by: Rob Hoes --- 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 84e1ad1..0c45743 100644 --- a/tools/ocaml/libs/xl/xenlight_stubs.c +++ b/tools/ocaml/libs/xl/xenlight_stubs.c @@ -967,11 +967,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