]> asedeno.scripts.mit.edu Git - PuTTY.git/commitdiff
Fix a double-free in Windows Pageant.
authorSimon Tatham <anakin@pobox.com>
Sun, 18 Oct 2015 19:22:05 +0000 (20:22 +0100)
committerSimon Tatham <anakin@pobox.com>
Sun, 18 Oct 2015 19:24:51 +0000 (20:24 +0100)
Reported by Colin Harrison; occurred on the error path in which the
user clicks 'cancel' in the passphrase box.

windows/winpgnt.c

index fa4d1d101c33c6113fad3353967ee7911ca292be..7bdf6378f956f760b4a4a3d48207c6812536030f 100644 (file)
@@ -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);