Kai Jourdan spotted a rather embarrassing double-free, and Minefield
authorsimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Fri, 26 Jan 2007 14:06:08 +0000 (14:06 +0000)
committersimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Fri, 26 Jan 2007 14:06:08 +0000 (14:06 +0000)
confirms that it's a real problem.

git-svn-id: svn://svn.tartarus.org/sgt/putty@7168 cda61777-01e9-0310-a592-d414129be87e

windows/window.c

index dca27a4..477e633 100644 (file)
@@ -816,9 +816,8 @@ int WINAPI WinMain(HINSTANCE inst, HINSTANCE prev, LPSTR cmdline, int show)
            sfree(handles);
            if (must_close_session)
                close_session();
-       }
-
-       sfree(handles);
+       } else
+           sfree(handles);
 
        while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) {
            if (msg.message == WM_QUIT)