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);
......@@ -986,13 +984,19 @@ static DWORD WINAPI local_server_thread(LPVOID param)
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