From eec6666ff93488405cf2c6f1db86e271dd51648e Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Thu, 17 Jan 2019 18:26:24 +0000 Subject: [PATCH] cmdgen: fix double-free on exit. Freeing ssh1key->comment before calling freersakey() on the whole of ssh1key is redundant, and worse, because we also didn't null out the freed pointer, causes a double-free. --- cmdgen.c | 1 - 1 file changed, 1 deletion(-) diff --git a/cmdgen.c b/cmdgen.c index 9892dec8..bf6cae39 100644 --- a/cmdgen.c +++ b/cmdgen.c @@ -1064,7 +1064,6 @@ int main(int argc, char **argv) } if (ssh1key) { - sfree(ssh1key->comment); freersakey(ssh1key); } if (ssh2key) {