diff options
author | Damien Miller <djm@mindrot.org> | 2003-03-10 11:21:17 +1100 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2003-03-10 11:21:17 +1100 |
commit | 0011138d47e284273ba77415f7162aaab60d9a44 (patch) | |
tree | c175bfc5d470a641dfc727490eec5765903992d2 /ssh-add.c | |
parent | 73942b9d54ec71ae76e58d5bf3b06f094bfc3002 (diff) |
- (djm) OpenBSD CVS Sync
- markus@cvs.openbsd.org 2003/03/05 22:33:43
[channels.c monitor.c scp.c session.c sftp-client.c sftp-int.c]
[sftp-server.c ssh-add.c sshconnect2.c]
fix memory leaks; from dlheine@suif.Stanford.EDU/CLOUSEAU; ok djm@
Diffstat (limited to 'ssh-add.c')
-rw-r--r-- | ssh-add.c | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -35,7 +35,7 @@ | |||
35 | */ | 35 | */ |
36 | 36 | ||
37 | #include "includes.h" | 37 | #include "includes.h" |
38 | RCSID("$OpenBSD: ssh-add.c,v 1.65 2003/01/23 13:50:27 markus Exp $"); | 38 | RCSID("$OpenBSD: ssh-add.c,v 1.66 2003/03/05 22:33:43 markus Exp $"); |
39 | 39 | ||
40 | #include <openssl/evp.h> | 40 | #include <openssl/evp.h> |
41 | 41 | ||
@@ -195,6 +195,7 @@ static int | |||
195 | update_card(AuthenticationConnection *ac, int add, const char *id) | 195 | update_card(AuthenticationConnection *ac, int add, const char *id) |
196 | { | 196 | { |
197 | char *pin; | 197 | char *pin; |
198 | int ret = -1; | ||
198 | 199 | ||
199 | pin = read_passphrase("Enter passphrase for smartcard: ", RP_ALLOW_STDIN); | 200 | pin = read_passphrase("Enter passphrase for smartcard: ", RP_ALLOW_STDIN); |
200 | if (pin == NULL) | 201 | if (pin == NULL) |
@@ -203,12 +204,14 @@ update_card(AuthenticationConnection *ac, int add, const char *id) | |||
203 | if (ssh_update_card(ac, add, id, pin)) { | 204 | if (ssh_update_card(ac, add, id, pin)) { |
204 | fprintf(stderr, "Card %s: %s\n", | 205 | fprintf(stderr, "Card %s: %s\n", |
205 | add ? "added" : "removed", id); | 206 | add ? "added" : "removed", id); |
206 | return 0; | 207 | ret = 0; |
207 | } else { | 208 | } else { |
208 | fprintf(stderr, "Could not %s card: %s\n", | 209 | fprintf(stderr, "Could not %s card: %s\n", |
209 | add ? "add" : "remove", id); | 210 | add ? "add" : "remove", id); |
210 | return -1; | 211 | ret = -1; |
211 | } | 212 | } |
213 | xfree(pin); | ||
214 | return ret; | ||
212 | } | 215 | } |
213 | 216 | ||
214 | static int | 217 | static int |