1
0
mirror of https://git.libssh.org/projects/libssh.git synced 2025-11-30 13:01:23 +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,13 +63,14 @@
* @{
*/
static ssh_message ssh_message_new(ssh_session session){
ssh_message msg = malloc(sizeof(struct ssh_message_struct));
static ssh_message ssh_message_new(ssh_session session)
{
ssh_message msg = calloc(1, sizeof(struct ssh_message_struct));
if (msg == NULL) {
return NULL;
}
ZERO_STRUCTP(msg);
msg->session = session;
return msg;
}