From 0fdf8c3d4a4348452f28c037e422c489605c91d7 Mon Sep 17 00:00:00 2001 From: Peter Wu Date: Tue, 7 Jul 2015 15:50:52 +0200 Subject: sexp: fix invalid deallocation in error path * src/sexp.c: Fix wrong condition in error path. -- This appears to be a copy and paste error and could result in wrong memory being freed in the error path (when arrayisdesx[idx] == 2, the condition ((!2) == 1) is false). Signed-off-by: Peter Wu --- src/sexp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sexp.c b/src/sexp.c index 9bc13caf..1c014e0c 100644 --- a/src/sexp.c +++ b/src/sexp.c @@ -2405,7 +2405,7 @@ _gcry_sexp_vextract_param (gcry_sexp_t sexp, const char *path, _gcry_mpi_release (*array[idx]); *array[idx] = NULL; } - else if (!arrayisdesc[idx] == 1) + else if (arrayisdesc[idx] == 1) { /* Caller provided buffer. */ gcry_buffer_t *spec = (gcry_buffer_t*)array[idx]; -- cgit v1.2.1