1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-02-03 21:52:24 +00:00

Fix a double error handling goof in the winstore side of the jump list

support: transform_jumplist_registry should give its caller
dynamically allocated data if and only if it returns JUMPLISTREG_OK,
and get_jumplist_registry_entries should test the return value against
JUMPLISTREG_OK rather than a value from a totally different enum.

[originally from svn r9960]
This commit is contained in:
Simon Tatham 2013-07-22 07:11:58 +00:00
parent b99bec3b02
commit f9f93584c2

View File

@ -749,7 +749,7 @@ static int transform_jumplist_registry
/* /*
* Either return or free the result. * Either return or free the result.
*/ */
if (out) if (out && ret == ERROR_SUCCESS)
*out = old_value; *out = old_value;
else else
sfree(old_value); sfree(old_value);
@ -782,7 +782,7 @@ char *get_jumplist_registry_entries (void)
{ {
char *list_value; char *list_value;
if (transform_jumplist_registry(NULL,NULL,&list_value) != ERROR_SUCCESS) { if (transform_jumplist_registry(NULL,NULL,&list_value) != JUMPLISTREG_OK) {
list_value = snewn(2, char); list_value = snewn(2, char);
*list_value = '\0'; *list_value = '\0';
*(list_value + 1) = '\0'; *(list_value + 1) = '\0';