summaryrefslogtreecommitdiff
path: root/src/cli.c
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@gnutls.org>2017-09-23 10:47:15 +0200
committerNikos Mavrogiannopoulos <nmav@gnutls.org>2017-09-23 10:47:15 +0200
commite2a05b97131f082303be1531fc43183acf01eb65 (patch)
treeae90e4a58c85b345367d6b1f836a0ea2d2f6447c /src/cli.c
parentf7aa74440684891fca57ac57f14a198db59006f0 (diff)
downloadgnutls-e2a05b97131f082303be1531fc43183acf01eb65.tar.gz
gnutls-cli: eliminate few memory leaks
Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
Diffstat (limited to 'src/cli.c')
-rw-r--r--src/cli.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/cli.c b/src/cli.c
index b2db7bc101..7207618bf4 100644
--- a/src/cli.c
+++ b/src/cli.c
@@ -1138,8 +1138,10 @@ int main(int argc, char **argv)
printf("- Handshake was completed\n");
if (resume != 0)
- if (try_resume(&hd))
- return 1;
+ if (try_resume(&hd)) {
+ retval = 1;
+ goto cleanup;
+ }
print_other_info(hd.session);
}
@@ -1149,8 +1151,10 @@ int main(int argc, char **argv)
printf("\n- Simple Client Mode:\n\n");
if (rehandshake)
- if (try_rehandshake(&hd))
- return 1;
+ if (try_rehandshake(&hd)) {
+ retval = 1;
+ goto cleanup;
+ }
#ifndef _WIN32
new_action.sa_handler = starttls_alarm;
@@ -1319,6 +1323,7 @@ int main(int argc, char **argv)
}
}
+ cleanup:
if (user_term != 0)
socket_bye(&hd, 1);
else