mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 01:55:19 +00:00
[REGEDIT] Fix HeapFree() on the wrong variable (#2736)
- When exporting registry keys (to .reg files) some variables from the heap are not free'd while the debug log indicates "HEAP: Trying to free an invalid address". - This is due to the export_registry_key() function that calls HeapFree() for reg_key_name. But this variable is an argument provided by the caller, which is always a statically defined array of WCHAR. - Meanwhile reg_key_name_buf is never free'd and cause a memory leak each time the function gets called.
This commit is contained in:
parent
9634a31589
commit
0461de33c5
1 changed files with 1 additions and 1 deletions
|
@ -1392,7 +1392,7 @@ BOOL export_registry_key(WCHAR *file_name, WCHAR *reg_key_name, DWORD format)
|
|||
if (file) {
|
||||
fclose(file);
|
||||
}
|
||||
HeapFree(GetProcessHeap(), 0, reg_key_name);
|
||||
HeapFree(GetProcessHeap(), 0, reg_key_name_buf);
|
||||
HeapFree(GetProcessHeap(), 0, val_name_buf);
|
||||
HeapFree(GetProcessHeap(), 0, val_buf);
|
||||
HeapFree(GetProcessHeap(), 0, line_buf);
|
||||
|
|
Loading…
Reference in a new issue