diff options
author | Andreas Schneider <asn@cryptomilk.org> | 2018-09-28 15:36:28 +0200 |
---|---|---|
committer | Andreas Schneider <asn@cryptomilk.org> | 2018-10-19 22:01:28 +0200 |
commit | be6c24c222a7028e088e92fde40deb228629a3a6 (patch) | |
tree | 29f434bf83f716e2256ac8f1f0f1e3442837e200 | |
parent | 733a702272898d2c6c1fbd377c877ce970cd89b3 (diff) | |
download | libssh-be6c24c222a7028e088e92fde40deb228629a3a6.tar.gz libssh-be6c24c222a7028e088e92fde40deb228629a3a6.tar.xz libssh-be6c24c222a7028e088e92fde40deb228629a3a6.zip |
messages: Use calloc in ssh_message_new()
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
-rw-r--r-- | src/messages.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/messages.c b/src/messages.c index ece578f4..4b293751 100644 --- a/src/messages.c +++ b/src/messages.c @@ -63,14 +63,15 @@ * @{ */ -static ssh_message ssh_message_new(ssh_session session){ - ssh_message msg = malloc(sizeof(struct ssh_message_struct)); - if (msg == NULL) { - return NULL; - } - ZERO_STRUCTP(msg); - msg->session = session; - return msg; +static ssh_message ssh_message_new(ssh_session session) +{ + ssh_message msg = calloc(1, sizeof(struct ssh_message_struct)); + if (msg == NULL) { + return NULL; + } + msg->session = session; + + return msg; } #ifndef WITH_SERVER |