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;