Commit 9386cb22 authored by Mike McCormack's avatar Mike McCormack Committed by Alexandre Julliard

Use Heap functions instead of malloc/free.

parent 55defb65
......@@ -490,11 +490,11 @@ INT16 WINAPI OpenComm16(LPCSTR device,UINT16 cbInQueue,UINT16 cbOutQueue)
COM[port].obuf_size = cbOutQueue;
COM[port].obuf_head = COM[port].obuf_tail = 0;
COM[port].inbuf = malloc(cbInQueue);
COM[port].inbuf = HeapAlloc(GetProcessHeap(), 0, cbInQueue);
if (COM[port].inbuf) {
COM[port].outbuf = malloc(cbOutQueue);
COM[port].outbuf = HeapAlloc( GetProcessHeap(), 0, cbOutQueue);
if (!COM[port].outbuf)
free(COM[port].inbuf);
HeapFree( GetProcessHeap(), 0, COM[port].inbuf);
} else COM[port].outbuf = NULL;
if (!COM[port].outbuf) {
/* not enough memory */
......@@ -551,8 +551,8 @@ INT16 WINAPI CloseComm16(INT16 cid)
CancelIo(ptr->handle);
/* free buffers */
free(ptr->outbuf);
free(ptr->inbuf);
HeapFree( GetProcessHeap(), 0, ptr->outbuf);
HeapFree( GetProcessHeap(), 0, ptr->inbuf);
/* reset modem lines */
SetCommState16(&COM[cid].dcb);
......
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