From: Jonathan McDowell Date: Sun, 18 Aug 2019 18:03:44 +0000 (+0100) Subject: Fix up memory leaks in fs keydb backend deletion X-Git-Tag: onak-0.6.0~32 X-Git-Url: https://the.earth.li/gitweb/?a=commitdiff_plain;h=a8c0920cce727a12697154a85896f2a3ba47eb75;p=onak.git Fix up memory leaks in fs keydb backend deletion We need to clean up the wordlist we created, as well as the copy of the actual key we retrieved. --- diff --git a/keydb_fs.c b/keydb_fs.c index 01874ee..aabb616 100644 --- a/keydb_fs.c +++ b/keydb_fs.c @@ -435,6 +435,8 @@ static int fs_delete_key(struct onak_dbctx *dbctx, wl = wl->next; } + llfree(wordlist, free); + wordlist = NULL; subkeyids = keysubkeys(pk); i = 0; @@ -463,6 +465,8 @@ static int fs_delete_key(struct onak_dbctx *dbctx, keypath(buffer, sizeof(buffer), keyid, dbctx->config->location); unlink(buffer); + free_publickey(pk); + if (!intrans) fs_endtrans(dbctx); return 1;