diff options
author | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2017-09-23 10:47:15 +0200 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2017-09-23 10:47:15 +0200 |
commit | e2a05b97131f082303be1531fc43183acf01eb65 (patch) | |
tree | ae90e4a58c85b345367d6b1f836a0ea2d2f6447c /src/cli.c | |
parent | f7aa74440684891fca57ac57f14a198db59006f0 (diff) | |
download | gnutls-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.c | 13 |
1 files changed, 9 insertions, 4 deletions
@@ -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 |