summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorPaul Wise <pabs3@bonedaddy.net>2012-09-05 11:44:52 +0200
committerBerke Viktor <bviktor@hexchat.org>2012-09-05 11:44:52 +0200
commit8cf6d493c61d5838ada916c7df1f729aa4631487 (patch)
tree3586ff6ac68a12f5f201dcc89b6769d66a4ebd07
parent6e5c314e6118796ebec83bac251d7c114f3015b2 (diff)
Fix unchecked malloc
-rw-r--r--src/common/xchat.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/common/xchat.c b/src/common/xchat.c
index 21e2bd9e..12c31379 100644
--- a/src/common/xchat.c
+++ b/src/common/xchat.c
@@ -351,6 +351,10 @@ session_new (server *serv, char *from, int type, int focus)
 	session *sess;
 
 	sess = malloc (sizeof (struct session));
+	if (sess == NULL)
+	{
+		return NULL;
+	}
 	memset (sess, 0, sizeof (struct session));
 
 	sess->server = serv;