Fix unchecked malloc

This commit is contained in:
Paul Wise 2012-09-05 11:44:52 +02:00 committed by Berke Viktor
parent 6e5c314e61
commit 8cf6d493c6
1 changed files with 4 additions and 0 deletions

View File

@ -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;