summaryrefslogtreecommitdiff
path: root/ct_client.c
diff options
context:
space:
mode:
Diffstat (limited to 'ct_client.c')
-rw-r--r--ct_client.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/ct_client.c b/ct_client.c
index 1f4d10e..37b6090 100644
--- a/ct_client.c
+++ b/ct_client.c
@@ -315,10 +315,7 @@ retry:
syslog(LOG_INFO, "curvetun client booting!\n");
}
- c = xmalloc(sizeof(struct curve25519_struct));
-
- curve25519_alloc_or_maybe_die(c);
-
+ c = curve25519_tfm_alloc();
p = get_serv_store_entry_proto_inf();
if (!p)
syslog_panic("Cannot proto!\n");
@@ -332,8 +329,7 @@ retry:
ret = getaddrinfo(host, port, &hints, &ahead);
if (ret < 0) {
syslog(LOG_ERR, "Cannot get address info! Retry!\n");
- curve25519_free(c);
- xfree(c);
+ curve25519_tfm_free(c);
fd = -1;
retry_server = 1;
closed_by_server = 0;
@@ -364,8 +360,7 @@ retry:
if (fd < 0) {
syslog(LOG_ERR, "Cannot create socket! Retry!\n");
- curve25519_free(c);
- xfree(c);
+ curve25519_tfm_free(c);
fd = -1;
retry_server = 1;
closed_by_server = 0;
@@ -422,8 +417,7 @@ retry:
xfree(buff);
close(fd);
- curve25519_free(c);
- xfree(c);
+ curve25519_tfm_free(c);
/* tundev still active */
if (closed_by_server && !sigint) {