From 3e4f466d5224af50c6789894cca459aa4504ef47 Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Sun, 30 Aug 2015 14:28:32 -0400 Subject: [PATCH] Fix incorrect free() usage This code has been changed to use apr pools for memory allocation, so the error path is wrong as free() is not called on malloc()ed memory anymore. Remove the calls to free(), the mempool is clean up by callers. Signed-off-by: Simo Sorce --- src/crypto.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/crypto.c b/src/crypto.c index 07c078c..1983a55 100644 --- a/src/crypto.c +++ b/src/crypto.c @@ -72,11 +72,7 @@ apr_status_t SEAL_KEY_CREATE(apr_pool_t *p, struct seal_key **skey, ret = 0; done: - if (ret) { - free(n->ekey); - free(n->hkey); - free(n); - } else { + if (ret == 0) { *skey = n; } return ret; -- 2.1.4