Fix a bug caused by freeing memory too soon in the table code.

This commit is contained in:
Mike McCormack 2005-01-20 19:57:22 +00:00 committed by Alexandre Julliard
parent 18b1fe8dee
commit 48df747150
1 changed files with 3 additions and 3 deletions

View File

@ -196,8 +196,8 @@ void enum_stream_names( IStorage *stg )
if( FAILED( r ) || !count )
break;
decode_streamname( stat.pwcsName, name );
ERR("stream %2ld -> %s %s\n", n,
debugstr_w(stat.pwcsName), debugstr_w(name) );
TRACE("stream %2ld -> %s %s\n", n,
debugstr_w(stat.pwcsName), debugstr_w(name) );
n++;
}
@ -356,12 +356,12 @@ static UINT write_stream_data( IStorage *stg, LPCWSTR stname,
encname = encode_streamname(TRUE, stname );
r = IStorage_OpenStream( stg, encname, NULL,
STGM_WRITE | STGM_SHARE_EXCLUSIVE, 0, &stm);
HeapFree( GetProcessHeap(), 0, encname );
if( FAILED(r) )
{
r = IStorage_CreateStream( stg, encname,
STGM_WRITE | STGM_SHARE_EXCLUSIVE, 0, 0, &stm);
}
HeapFree( GetProcessHeap(), 0, encname );
if( FAILED( r ) )
{
ERR("open stream failed r = %08lx\n",r);