aboutsummaryrefslogtreecommitdiff
path: root/src/proone.c
diff options
context:
space:
mode:
authorDavid Timber <mieabby@gmail.com>2020-09-15 20:04:13 +0930
committerDavid Timber <mieabby@gmail.com>2020-09-15 20:04:13 +0930
commitca0c9a60b0f7dc823ff01f77fc00458ab4a13532 (patch)
treef361382866540b5666a74084133cd2fb51f16e71 /src/proone.c
parentd06a39d44741355e96ee96d8f760b995f35abaed (diff)
* Code consistency - take *_param_t as pointer
* Fix *_param_t leak and memory error
Diffstat (limited to 'src/proone.c')
-rw-r--r--src/proone.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/proone.c b/src/proone.c
index 75c73f5..7f0ebf0 100644
--- a/src/proone.c
+++ b/src/proone.c
@@ -18,6 +18,7 @@
#include <mbedtls/sha256.h>
#include <mbedtls/base64.h>
+#include <libssh2.h>
#include "config.h"
#include "proone.h"
@@ -212,7 +213,7 @@ static void alloc_htbt (void) {
prne_g.htbt = prne_alloc_htbt(
wkr_arr + wkr_cnt,
- param);
+ &param);
if (prne_g.htbt != NULL) {
wkr_cnt += 1;
}
@@ -273,6 +274,7 @@ static int proone_main (void) {
static int caught_sig;
prne_assert(pth_init());
+ prne_assert(libssh2_init(0) == 0);
prne_g.main_pth = pth_self();
seed_ssl_rnd(true);
@@ -302,6 +304,7 @@ static int proone_main (void) {
free_workers();
pth_kill();
+ libssh2_exit();
return 0;
}