diff options
author | 2003-03-05 22:33:43 +0000 | |
---|---|---|
committer | 2003-03-05 22:33:43 +0000 | |
commit | ce850b032b66ce5ec1fcf20b26e03ac295ba3db5 (patch) | |
tree | 299a43373b41c270a5c1399d2a1942948eed2ae7 /usr.bin/ssh/ssh-add.c | |
parent | delete blank lines (diff) | |
download | wireguard-openbsd-ce850b032b66ce5ec1fcf20b26e03ac295ba3db5.tar.xz wireguard-openbsd-ce850b032b66ce5ec1fcf20b26e03ac295ba3db5.zip |
fix memory leaks; from dlheine@suif.Stanford.EDU/CLOUSEAU; ok djm@
Diffstat (limited to 'usr.bin/ssh/ssh-add.c')
-rw-r--r-- | usr.bin/ssh/ssh-add.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/usr.bin/ssh/ssh-add.c b/usr.bin/ssh/ssh-add.c index a371751f567..08c545ab8c6 100644 --- a/usr.bin/ssh/ssh-add.c +++ b/usr.bin/ssh/ssh-add.c @@ -35,7 +35,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: ssh-add.c,v 1.65 2003/01/23 13:50:27 markus Exp $"); +RCSID("$OpenBSD: ssh-add.c,v 1.66 2003/03/05 22:33:43 markus Exp $"); #include <openssl/evp.h> @@ -189,6 +189,7 @@ static int update_card(AuthenticationConnection *ac, int add, const char *id) { char *pin; + int ret = -1; pin = read_passphrase("Enter passphrase for smartcard: ", RP_ALLOW_STDIN); if (pin == NULL) @@ -197,12 +198,14 @@ update_card(AuthenticationConnection *ac, int add, const char *id) if (ssh_update_card(ac, add, id, pin)) { fprintf(stderr, "Card %s: %s\n", add ? "added" : "removed", id); - return 0; + ret = 0; } else { fprintf(stderr, "Could not %s card: %s\n", add ? "add" : "remove", id); - return -1; + ret = -1; } + xfree(pin); + return ret; } static int |