Vyacheslav Andrejev points out a heap management goof in the new jump
authorsimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Wed, 29 Dec 2010 13:35:44 +0000 (13:35 +0000)
committersimon <simon@cda61777-01e9-0310-a592-d414129be87e>
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!

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

windows/winstore.c

index 99b1ab8..aae5a4c 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;