mirror of
https://github.com/ZoiteChat/zoitechat.git
synced 2026-10-28 06:15:38 +00:00
Fix unchecked malloc
This commit is contained in:
1 parent
6e5c314e61
commit
8cf6d493c6
1 file changed
+4
@@ -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;
|
||||
|
||||
Reference in new issue
Block a user