diff src/readsock.c @ 377:9bc3e47b0222

Various cleanups to remove compiler warnings. We're clean now, if we specify `-Wno-pointer-sign'.
author markus schnalke <meillo@marmaro.de>
date Sat, 14 Jan 2012 18:44:48 +0100
parents b35c17fcf69d
children
line wrap: on
line diff
--- a/src/readsock.c	Sat Jan 14 18:20:03 2012 +0100
+++ b/src/readsock.c	Sat Jan 14 18:44:48 2012 +0100
@@ -25,7 +25,6 @@
 #include <ctype.h>
 
 #include "readsock.h"
-/*#include "masqmail.h"*/
 
 jmp_buf jmp_timeout;
 
@@ -150,8 +149,13 @@
 		_read_chug(in);
 	}
 
-	if (!*pbuf)
-		*pbuf = (char *) g_malloc(size);
+	if (!*pbuf) {
+		*pbuf = (char *) malloc(size);
+		if (!*pbuf) {
+			fprintf(stderr, "Out of memory.\n");
+			exit(1);
+		}
+	}
 	buf = *pbuf;
 
 	while (1) {