]> asedeno.scripts.mit.edu Git - PuTTY.git/commitdiff
Vyacheslav Andrejev points out a heap management goof in the new jump
authorSimon Tatham <anakin@pobox.com>
Wed, 29 Dec 2010 13:35:44 +0000 (13:35 +0000)
committerSimon Tatham <anakin@pobox.com>
Wed, 29 Dec 2010 13:35:44 +0000 (13:35 +0000)
list code. Free the old value of the pointer variable we just
overwrote, not the new one!

[originally from svn r9062]

windows/winstore.c

index 99b1ab8a572d287f3da52ae010883d69d9992969..aae5a4c6f5bab6dc89fcb44008db616986ebf1a8 100644 (file)
@@ -699,8 +699,8 @@ static int transform_jumplist_registry
         ret = RegSetValueEx(pjumplist_key, reg_jumplist_value, 0, REG_MULTI_SZ,
                             new_value, piterator_new - new_value);
 
+        sfree(old_value);
         old_value = new_value;
-        sfree(new_value);
     } else
         ret = ERROR_SUCCESS;