"James Hawkins" truiken@gmail.com writes:
+static LPWSTR msi_read_text_archive(LPCWSTR path) {
- FIXME("%p %s %s\n", db, debugstr_w(folder), debugstr_w(file) );
- HANDLE file;
- LPSTR data = NULL;
- DWORD read, size = 0;
- file = CreateFileW( path, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, NULL );
- if (file == INVALID_HANDLE_VALUE)
return NULL;
- size = GetFileSize( file, NULL );
- data = msi_alloc( size + 1 );
- if (!data)
return NULL;
- if (!ReadFile( file, data, size, &read, NULL ))
return NULL;
- data[size] = '\0';
- return strdupAtoW( data );
+}
You're leaking both the file and the ascii string.