Commit 8ea62f2e authored by Sven Baars's avatar Sven Baars Committed by Alexandre Julliard

kernel32: Fix some string leaks (Coverity).

parent d2496e2d
...@@ -1775,11 +1775,13 @@ BOOL WINAPI WritePrivateProfileSectionW( LPCWSTR section, ...@@ -1775,11 +1775,13 @@ BOOL WINAPI WritePrivateProfileSectionW( LPCWSTR section,
RegCloseKey( section_key ); RegCloseKey( section_key );
if (res) if (res)
{ {
HeapFree( GetProcessHeap(), 0, entry_copy );
SetLastError( res ); SetLastError( res );
RegCloseKey( key ); RegCloseKey( key );
return FALSE; return FALSE;
} }
} }
HeapFree( GetProcessHeap(), 0, entry_copy );
} }
} }
RegCloseKey( key ); RegCloseKey( key );
...@@ -1917,6 +1919,7 @@ DWORD WINAPI GetPrivateProfileSectionNamesW( LPWSTR buffer, DWORD size, ...@@ -1917,6 +1919,7 @@ DWORD WINAPI GetPrivateProfileSectionNamesW( LPWSTR buffer, DWORD size,
{ {
lstrcpynW( buffer + ret, section, size - ret - 1 ); lstrcpynW( buffer + ret, section, size - ret - 1 );
ret = min( ret + strlenW( section ) + 1, size - 1 ); ret = min( ret + strlenW( section ) + 1, size - 1 );
HeapFree( GetProcessHeap(), 0, section );
} }
RegCloseKey( key ); RegCloseKey( key );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment