Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 0.8, 0.8.1, and 0.8.2

shellext: fix registry handle leak in GetRegistryConfig()

Changeset 4af261cfb396

Parent 870c22af24f7

by Adrian Buehlmann

Changes to one file · Browse files at 4af261cfb396 Showing diff from parent 870c22af24f7 Diff from another changeset...

 
111
112
113
114
115
 
 
 
 
 
 
116
117
118
 
 
119
120
121
 
111
112
113
 
 
114
115
116
117
118
119
120
 
 
121
122
123
124
125
@@ -111,11 +111,15 @@
  rv = RegQueryValueExA(   hkey, name.c_str(), 0, 0, Data, &cbData);   - if (rv != ERROR_SUCCESS) - return 0; + int ret = 0; + if (rv == ERROR_SUCCESS) + { + res = reinterpret_cast<const char*>(&Data); + ret = 1; + }   - res = reinterpret_cast<const char*>(&Data); - return 1; + RegCloseKey(hkey); + return ret;  }