From c01dff38a3c260d140669f8939ef4b6e7842018c Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Sun, 18 Oct 2015 20:22:05 +0100 Subject: [PATCH] Fix a double-free in Windows Pageant. Reported by Colin Harrison; occurred on the error path in which the user clicks 'cancel' in the passphrase box. --- windows/winpgnt.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/windows/winpgnt.c b/windows/winpgnt.c index fa4d1d10..7bdf6378 100644 --- a/windows/winpgnt.c +++ b/windows/winpgnt.c @@ -377,11 +377,11 @@ static void win_add_keyfile(Filename *filename) NULL, PassphraseProc, (LPARAM) &pps); passphrase_box = NULL; - sfree(err); - if (!dlgret) goto done; /* operation cancelled */ + sfree(err); + assert(passphrase != NULL); ret = pageant_add_keyfile(filename, passphrase, &err);