diff options
author | David Howells <dhowells@redhat.com> | 2014-01-15 15:07:06 +0000 |
---|---|---|
committer | David Howells <dhowells@redhat.com> | 2014-01-15 15:07:06 +0000 |
commit | f36abed25446e8ce56f7b6316cbd9ca49b925072 (patch) | |
tree | 30a9d3bc0f5d3a8a3f455127dde481d482abdc52 | |
parent | 47cf4085c2525c8a15607b5ae0726cde0f3ec413 (diff) | |
download | keyutils-f36abed25446e8ce56f7b6316cbd9ca49b925072.tar.gz |
Fix memory leak in dump_key_tree_aux() in the keyctl program
Fix a leak of the description string memory from each key visited in
dump_key_tree_aux() in the keyctl program.
Signed-off-by: David Howells <dhowells@redhat.com>
-rw-r--r-- | keyctl.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -1735,6 +1735,8 @@ static int dump_key_tree_aux(key_serial_t key, int depth, int more, int hex_key_ depth > 0 ? "\\_ " : "", type, desc + dpos); + free(desc); + /* if it's a keyring then we're going to want to recursively * display it if we can */ if (strcmp(type, "keyring") == 0) { @@ -1793,7 +1795,6 @@ static int dump_key_tree_aux(key_serial_t key, int depth, int more, int hex_key_ free(payload); } - free(desc); return kcount; } /* end dump_key_tree_aux() */ |