diff options
author | Andreas Schneider <asn@cryptomilk.org> | 2018-09-28 15:36:28 +0200 |
---|---|---|
committer | Andreas Schneider <asn@cryptomilk.org> | 2018-10-24 09:48:35 +0200 |
commit | b9ac61d5a3a0b3f052094bf2eba7a1ac7942ce99 (patch) | |
tree | 7dbd120f3dfc2a559e5def24e1ecf33e9d321ba2 /src/messages.c | |
parent | ca425ebe6727063d26de7da194b50f675d00d952 (diff) | |
download | libssh-b9ac61d5a3a0b3f052094bf2eba7a1ac7942ce99.tar.gz libssh-b9ac61d5a3a0b3f052094bf2eba7a1ac7942ce99.tar.xz libssh-b9ac61d5a3a0b3f052094bf2eba7a1ac7942ce99.zip |
messages: Use calloc in ssh_message_new()
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Diffstat (limited to 'src/messages.c')
-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 |