Skip to content

Commit 3e4f466

Browse files
committed
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 <simo@redhat.com>
1 parent f206c24 commit 3e4f466

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

src/crypto.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,7 @@ apr_status_t SEAL_KEY_CREATE(apr_pool_t *p, struct seal_key **skey,
7272

7373
ret = 0;
7474
done:
75-
if (ret) {
76-
free(n->ekey);
77-
free(n->hkey);
78-
free(n);
79-
} else {
75+
if (ret == 0) {
8076
*skey = n;
8177
}
8278
return ret;

0 commit comments

Comments
 (0)