aboutsummaryrefslogtreecommitdiff
path: root/src/socket.c
diff options
context:
space:
mode:
authorAnderson Toshiyuki Sasaki <ansasaki@redhat.com>2019-05-20 17:10:57 +0200
committerAndreas Schneider <asn@cryptomilk.org>2019-05-22 15:32:41 +0200
commit9fb7fb3fac58445debfb486a26fe4ea20816abab (patch)
tree952d411ba186883d8cd075c89e421e15057b031f /src/socket.c
parent59ba3f18963c88aa46645437ed937f50a2d91730 (diff)
downloadlibssh-9fb7fb3fac58445debfb486a26fe4ea20816abab.tar.gz
libssh-9fb7fb3fac58445debfb486a26fe4ea20816abab.tar.xz
libssh-9fb7fb3fac58445debfb486a26fe4ea20816abab.zip
socket: Use calloc in ssh_socket_new()
This makes sure the content will be zero after successful allocation. Resolves T134 Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
Diffstat (limited to 'src/socket.c')
-rw-r--r--src/socket.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/socket.c b/src/socket.c
index e155a50a..5ea376e0 100644
--- a/src/socket.c
+++ b/src/socket.c
@@ -142,7 +142,7 @@ void ssh_socket_cleanup(void) {
ssh_socket ssh_socket_new(ssh_session session) {
ssh_socket s;
- s = malloc(sizeof(struct ssh_socket_struct));
+ s = calloc(1, sizeof(struct ssh_socket_struct));
if (s == NULL) {
ssh_set_error_oom(session);
return NULL;