summaryrefslogtreecommitdiff
path: root/ssh-add.c
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2003-03-10 11:21:17 +1100
committerDamien Miller <djm@mindrot.org>2003-03-10 11:21:17 +1100
commit0011138d47e284273ba77415f7162aaab60d9a44 (patch)
treec175bfc5d470a641dfc727490eec5765903992d2 /ssh-add.c
parent73942b9d54ec71ae76e58d5bf3b06f094bfc3002 (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.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/ssh-add.c b/ssh-add.c
index 0c2ce163c..9adec3094 100644
--- a/ssh-add.c
+++ b/ssh-add.c
@@ -35,7 +35,7 @@
35 */ 35 */
36 36
37#include "includes.h" 37#include "includes.h"
38RCSID("$OpenBSD: ssh-add.c,v 1.65 2003/01/23 13:50:27 markus Exp $"); 38RCSID("$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
195update_card(AuthenticationConnection *ac, int add, const char *id) 195update_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
214static int 217static int