FlushWithReply(ReplyData *) checks for non-NULL buffers - eliminates a memory leak

git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2902 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
DarkWyrm 2003-03-12 18:01:55 +00:00
parent 781f2cb3d8
commit 71c040584c

View File

@ -344,7 +344,11 @@ printf("\tFlushWithReply(): unable to assign reply port to data\n");
{
data->buffersize=port_buffer_size(replyport);
if(data->buffersize>0)
{
if(data->buffer)
delete data->buffer;
data->buffer=(int8*)new int8[data->buffersize];
}
read_port(replyport,&(data->code),data->buffer, data->buffersize);
}
else
@ -354,7 +358,9 @@ printf("\tFlushWithReply(): unable to assign reply port to data\n");
return B_TIMED_OUT;
if(data->buffersize>0)
{
data->buffer=(int8*)new int8[data->buffersize];
}
read_port(replyport,&(data->code),data->buffer, data->buffersize);
}