summaryrefslogtreecommitdiff
path: root/ssh-add.c
diff options
context:
space:
mode:
Diffstat (limited to 'ssh-add.c')
-rw-r--r--ssh-add.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/ssh-add.c b/ssh-add.c
index 008084704..5e8166f66 100644
--- a/ssh-add.c
+++ b/ssh-add.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ssh-add.c,v 1.105 2012/12/05 15:42:52 markus Exp $ */ 1/* $OpenBSD: ssh-add.c,v 1.106 2013/05/17 00:13:14 djm Exp $ */
2/* 2/*
3 * Author: Tatu Ylonen <ylo@cs.hut.fi> 3 * Author: Tatu Ylonen <ylo@cs.hut.fi>
4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland 4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -90,7 +90,7 @@ clear_pass(void)
90{ 90{
91 if (pass) { 91 if (pass) {
92 memset(pass, 0, strlen(pass)); 92 memset(pass, 0, strlen(pass));
93 xfree(pass); 93 free(pass);
94 pass = NULL; 94 pass = NULL;
95 } 95 }
96} 96}
@@ -215,7 +215,7 @@ add_file(AuthenticationConnection *ac, const char *filename, int key_only)
215 pass = read_passphrase(msg, RP_ALLOW_STDIN); 215 pass = read_passphrase(msg, RP_ALLOW_STDIN);
216 if (strcmp(pass, "") == 0) { 216 if (strcmp(pass, "") == 0) {
217 clear_pass(); 217 clear_pass();
218 xfree(comment); 218 free(comment);
219 buffer_free(&keyblob); 219 buffer_free(&keyblob);
220 return -1; 220 return -1;
221 } 221 }
@@ -282,8 +282,8 @@ add_file(AuthenticationConnection *ac, const char *filename, int key_only)
282 fprintf(stderr, "The user must confirm each use of the key\n"); 282 fprintf(stderr, "The user must confirm each use of the key\n");
283 out: 283 out:
284 if (certpath != NULL) 284 if (certpath != NULL)
285 xfree(certpath); 285 free(certpath);
286 xfree(comment); 286 free(comment);
287 key_free(private); 287 key_free(private);
288 288
289 return ret; 289 return ret;
@@ -308,7 +308,7 @@ update_card(AuthenticationConnection *ac, int add, const char *id)
308 add ? "add" : "remove", id); 308 add ? "add" : "remove", id);
309 ret = -1; 309 ret = -1;
310 } 310 }
311 xfree(pin); 311 free(pin);
312 return ret; 312 return ret;
313} 313}
314 314
@@ -330,14 +330,14 @@ list_identities(AuthenticationConnection *ac, int do_fp)
330 SSH_FP_HEX); 330 SSH_FP_HEX);
331 printf("%d %s %s (%s)\n", 331 printf("%d %s %s (%s)\n",
332 key_size(key), fp, comment, key_type(key)); 332 key_size(key), fp, comment, key_type(key));
333 xfree(fp); 333 free(fp);
334 } else { 334 } else {
335 if (!key_write(key, stdout)) 335 if (!key_write(key, stdout))
336 fprintf(stderr, "key_write failed"); 336 fprintf(stderr, "key_write failed");
337 fprintf(stdout, " %s\n", comment); 337 fprintf(stdout, " %s\n", comment);
338 } 338 }
339 key_free(key); 339 key_free(key);
340 xfree(comment); 340 free(comment);
341 } 341 }
342 } 342 }
343 if (!had_identities) { 343 if (!had_identities) {
@@ -363,7 +363,7 @@ lock_agent(AuthenticationConnection *ac, int lock)
363 passok = 0; 363 passok = 0;
364 } 364 }
365 memset(p2, 0, strlen(p2)); 365 memset(p2, 0, strlen(p2));
366 xfree(p2); 366 free(p2);
367 } 367 }
368 if (passok && ssh_lock_agent(ac, lock, p1)) { 368 if (passok && ssh_lock_agent(ac, lock, p1)) {
369 fprintf(stderr, "Agent %slocked.\n", lock ? "" : "un"); 369 fprintf(stderr, "Agent %slocked.\n", lock ? "" : "un");
@@ -371,7 +371,7 @@ lock_agent(AuthenticationConnection *ac, int lock)
371 } else 371 } else
372 fprintf(stderr, "Failed to %slock agent.\n", lock ? "" : "un"); 372 fprintf(stderr, "Failed to %slock agent.\n", lock ? "" : "un");
373 memset(p1, 0, strlen(p1)); 373 memset(p1, 0, strlen(p1));
374 xfree(p1); 374 free(p1);
375 return (ret); 375 return (ret);
376} 376}
377 377