1
0
mirror of https://git.libssh.org/projects/libssh.git synced 2025-12-02 01:17:52 +03:00

messages: Use calloc in ssh_message_new()

Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
Andreas Schneider
2018-09-28 15:36:28 +02:00
parent ca425ebe67
commit b9ac61d5a3

View File

@@ -63,14 +63,15 @@
* @{ * @{
*/ */
static ssh_message ssh_message_new(ssh_session session){ static ssh_message ssh_message_new(ssh_session session)
ssh_message msg = malloc(sizeof(struct ssh_message_struct)); {
if (msg == NULL) { ssh_message msg = calloc(1, sizeof(struct ssh_message_struct));
return NULL; if (msg == NULL) {
} return NULL;
ZERO_STRUCTP(msg); }
msg->session = session; msg->session = session;
return msg;
return msg;
} }
#ifndef WITH_SERVER #ifndef WITH_SERVER