GNUTLS: Improve rb_connect_tcp_ssl() and rb_ssl_start_connected()

Use the variable name instead of its type as an argument to a sizeof
allocation. This will prevent possible future errors being introduced
when the type of the variable is changed, but the sizeof argument is
not updated.
This commit is contained in:
Aaron Jones 2016-09-16 21:54:53 +00:00
parent f4726edf7a
commit 2b5bf0bada
No known key found for this signature in database
GPG key ID: EC6F86EE9CD840B5

View file

@ -673,7 +673,7 @@ rb_connect_tcp_ssl(rb_fde_t *const F, struct sockaddr *const dest, struct sockad
if(F == NULL)
return;
struct ssl_connect *const sconn = rb_malloc(sizeof(struct ssl_connect));
struct ssl_connect *const sconn = rb_malloc(sizeof *sconn);
sconn->data = data;
sconn->callback = callback;
sconn->timeout = timeout;
@ -687,7 +687,7 @@ rb_ssl_start_connected(rb_fde_t *const F, CNCB *const callback, void *const data
if(F == NULL)
return;
struct ssl_connect *const sconn = rb_malloc(sizeof(struct ssl_connect));
struct ssl_connect *const sconn = rb_malloc(sizeof *sconn);
sconn->data = data;
sconn->callback = callback;
sconn->timeout = timeout;