1
0
mirror of https://github.com/wine-mirror/wine synced 2024-07-03 08:19:41 +00:00

winemsibuilder: Use CRT allocation functions.

Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
This commit is contained in:
Nikolay Sivov 2022-07-03 19:20:56 +03:00 committed by Alexandre Julliard
parent 5675994602
commit f059013a41

View File

@ -77,7 +77,7 @@ static int import_tables( const WCHAR *msifile, WCHAR **tables )
if (r != ERROR_SUCCESS) return 1; if (r != ERROR_SUCCESS) return 1;
len = GetCurrentDirectoryW( 0, NULL ); len = GetCurrentDirectoryW( 0, NULL );
if (!(dir = HeapAlloc( GetProcessHeap(), 0, (len + 1) * sizeof(WCHAR) ))) if (!(dir = malloc( (len + 1) * sizeof(WCHAR) )))
{ {
MsiCloseHandle( hdb ); MsiCloseHandle( hdb );
return 1; return 1;
@ -102,7 +102,7 @@ static int import_tables( const WCHAR *msifile, WCHAR **tables )
WINE_ERR( "failed to commit changes (%u)\n", r ); WINE_ERR( "failed to commit changes (%u)\n", r );
} }
HeapFree( GetProcessHeap(), 0, dir ); free( dir );
MsiCloseHandle( hdb ); MsiCloseHandle( hdb );
return (r != ERROR_SUCCESS); return (r != ERROR_SUCCESS);
} }
@ -135,7 +135,7 @@ static WCHAR *encode_stream( const WCHAR *in )
return NULL; return NULL;
count += 2; count += 2;
if (!(out = HeapAlloc( GetProcessHeap(), 0, count * sizeof(WCHAR) ))) return NULL; if (!(out = malloc( count * sizeof(WCHAR) ))) return NULL;
p = out; p = out;
while (count--) while (count--)
{ {
@ -162,7 +162,7 @@ static WCHAR *encode_stream( const WCHAR *in )
} }
*p++ = c; *p++ = c;
} }
HeapFree( GetProcessHeap(), 0, out ); free( out );
return NULL; return NULL;
} }
@ -236,7 +236,7 @@ static int add_stream( const WCHAR *msifile, const WCHAR *stream, const WCHAR *f
ret = 0; ret = 0;
done: done:
HeapFree( GetProcessHeap(), 0, encname ); free( encname );
if (stm) IStream_Release( stm ); if (stm) IStream_Release( stm );
IStorage_Release( stg ); IStorage_Release( stg );
return ret; return ret;