From a8c0920cce727a12697154a85896f2a3ba47eb75 Mon Sep 17 00:00:00 2001 From: Jonathan McDowell Date: Sun, 18 Aug 2019 19:03:44 +0100 Subject: [PATCH] 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. --- keydb_fs.c | 4 ++++ 1 file changed, 4 insertions(+) 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; -- 2.39.2