Fix incorrect free() usage
authorSimo Sorce <simo@redhat.com>
Sun, 30 Aug 2015 18:28:32 +0000 (14:28 -0400)
committerSimo Sorce <simo@redhat.com>
Sun, 30 Aug 2015 18:28:32 +0000 (14:28 -0400)
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 <simo@redhat.com>
src/crypto.c

index 07c078c..1983a55 100644 (file)
@@ -72,11 +72,7 @@ apr_status_t SEAL_KEY_CREATE(apr_pool_t *p, struct seal_key **skey,
 
     ret = 0;
 done:
 
     ret = 0;
 done:
-    if (ret) {
-        free(n->ekey);
-        free(n->hkey);
-        free(n);
-    } else {
+    if (ret == 0) {
         *skey = n;
     }
     return ret;
         *skey = n;
     }
     return ret;