From 9c67958c4737b34c60ef2076f57234eec155eb36 Mon Sep 17 00:00:00 2001 From: Justus Winter Date: Tue, 28 Jun 2016 18:13:40 +0200 Subject: gpgscm: Fix memory leaks. * tests/gpgscm/ffi-private.h (ffi_schemify_name): Fix prototype. (ffi_define_function_name): Free schemified name. (ffi_define_function): Likewise. (ffi_define_constant): Likewise. (ffi_define_variable_pointer): Likewise. * tests/gpgscm/ffi.c (do_wait_processes): Free arrays. (ffi_schemify_name): Fix type. * tests/gpgscm/main.c (main): Free 'sc'. Signed-off-by: Justus Winter --- tests/gpgscm/ffi.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'tests/gpgscm/ffi.c') diff --git a/tests/gpgscm/ffi.c b/tests/gpgscm/ffi.c index dcdadaa6c..acfe1c715 100644 --- a/tests/gpgscm/ffi.c +++ b/tests/gpgscm/ffi.c @@ -776,6 +776,9 @@ do_wait_processes (scheme *sc, pointer args) (long) retcodes[count-1-i]), retcodes_list); + xfree (names); + xfree (pids); + xfree (retcodes); FFI_RETURN_POINTER (sc, retcodes_list); } @@ -1098,7 +1101,7 @@ ffi_list2intv (scheme *sc, pointer list, int **intv, size_t *len) } -const char * +char * ffi_schemify_name (const char *s, int macro) { char *n = strdup (s), *p; -- cgit v1.2.3