summaryrefslogtreecommitdiff
path: root/ssh-add.c
diff options
context:
space:
mode:
authordjm <djm>2003-03-10 00:21:17 +0000
committerdjm <djm>2003-03-10 00:21:17 +0000
commit3ba86eded8425021ac67500800d3e6acfc124378 (patch)
tree900aa245783826640df4f44bff5bbfd1df00b57e /ssh-add.c
parent04bb527abc4bc08309889dc72a46c44258ca206b (diff)
downloadopenssh-3ba86eded8425021ac67500800d3e6acfc124378.tar.gz
- (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 0c2ce163..9adec309 100644
--- a/ssh-add.c
+++ b/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>
@@ -195,6 +195,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)
@@ -203,12 +204,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