Commit 352d9e2d authored by Robert Shearman's avatar Robert Shearman Committed by Alexandre Julliard

ole32: Free the buffer allocated in local_server_thread (found by Smatch).

parent 9c3b12bd
......@@ -976,8 +976,6 @@ static DWORD WINAPI local_server_thread(LPVOID param)
hres = IStream_Stat(pStm,&ststg,0);
if (hres) return hres;
buflen = ststg.cbSize.u.LowPart;
buffer = HeapAlloc(GetProcessHeap(),0,buflen);
seekto.u.LowPart = 0;
seekto.u.HighPart = 0;
hres = IStream_Seek(pStm,seekto,SEEK_SET,&newpos);
......@@ -985,14 +983,20 @@ static DWORD WINAPI local_server_thread(LPVOID param)
FIXME("IStream_Seek failed, %lx\n",hres);
return hres;
}
buflen = ststg.cbSize.u.LowPart;
buffer = HeapAlloc(GetProcessHeap(),0,buflen);
hres = IStream_Read(pStm,buffer,buflen,&res);
if (hres) {
FIXME("Stream Read failed, %lx\n",hres);
HeapFree(GetProcessHeap(),0,buffer);
return hres;
}
WriteFile(hPipe,buffer,buflen,&res,NULL);
HeapFree(GetProcessHeap(),0,buffer);
FlushFileBuffers(hPipe);
DisconnectNamedPipe(hPipe);
......
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