summaryrefslogtreecommitdiff
path: root/server.c
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2011-09-30 20:19:44 -0700
committerAlan Coopersmith <alan.coopersmith@oracle.com>2011-09-30 20:19:44 -0700
commitedca92c10572b6bb7dd60db156f545d98373f803 (patch)
tree0f22fb5c4203c48c2a8d7f6a71692f9b689d791d /server.c
parent93812aa7950342c809a9dcbd9d50379c050b51ac (diff)
downloadxscope-edca92c10572b6bb7dd60db156f545d98373f803.tar.gz
Stop wrapping malloc & free
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
Diffstat (limited to 'server.c')
-rw-r--r--server.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/server.c b/server.c
index e9c1d9e..0943eec 100644
--- a/server.c
+++ b/server.c
@@ -212,11 +212,13 @@ SaveBytes (
{
/* not enough room so far; malloc more space and copy */
long SizeofNewBytes = (CS[fd].NumberofSavedBytes + n + 1);
- unsigned char *NewBytes = (unsigned char *)Malloc (SizeofNewBytes);
+ unsigned char *NewBytes = malloc (SizeofNewBytes);
+ if (NewBytes == NULL)
+ panic("Can't allocate memory for SavedBytes");
bcopy(/* from */(char *)CS[fd].SavedBytes,
/* to */(char *)NewBytes,
/* count */(int)CS[fd].SizeofSavedBytes);
- Free((char *)CS[fd].SavedBytes);
+ free(CS[fd].SavedBytes);
CS[fd].SavedBytes = NewBytes;
CS[fd].SizeofSavedBytes = SizeofNewBytes;
}
@@ -471,7 +473,7 @@ StopClientConnection (
/* when a new connection is stopped, discard the old buffer */
if (CS[fd].SizeofSavedBytes > 0)
- Free((char*)CS[fd].SavedBytes);
+ free(CS[fd].SavedBytes);
}
long
@@ -622,7 +624,7 @@ StopServerConnection (
/* when a new connection is stopped, discard the old buffer */
if (CS[fd].SizeofSavedBytes > 0)
- Free((char *)CS[fd].SavedBytes);
+ free(CS[fd].SavedBytes);
}
long