summaryrefslogtreecommitdiff
path: root/ssh-pkcs11-helper.c
diff options
context:
space:
mode:
authorColin Watson <cjwatson@debian.org>2013-09-14 15:43:03 +0100
committerColin Watson <cjwatson@debian.org>2013-09-14 15:43:03 +0100
commit8faf8c84430cf3c19705b1d9f8889d256e7fd1fd (patch)
treee6cb74192adb00fda5e4d1457547851d7e0d86af /ssh-pkcs11-helper.c
parent328b60656f29db6306994d7498dede386ec2d1c3 (diff)
parentc41345ad7ee5a22689e2c009595e85fa27b4b39a (diff)
merge 6.3p1
Diffstat (limited to 'ssh-pkcs11-helper.c')
-rw-r--r--ssh-pkcs11-helper.c24
1 files changed, 11 insertions, 13 deletions
diff --git a/ssh-pkcs11-helper.c b/ssh-pkcs11-helper.c
index fcb5defc0..39b2e7c56 100644
--- a/ssh-pkcs11-helper.c
+++ b/ssh-pkcs11-helper.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ssh-pkcs11-helper.c,v 1.4 2012/07/02 12:13:26 dtucker Exp $ */ 1/* $OpenBSD: ssh-pkcs11-helper.c,v 1.6 2013/05/17 00:13:14 djm Exp $ */
2/* 2/*
3 * Copyright (c) 2010 Markus Friedl. All rights reserved. 3 * Copyright (c) 2010 Markus Friedl. All rights reserved.
4 * 4 *
@@ -79,7 +79,7 @@ del_keys_by_name(char *name)
79 nxt = TAILQ_NEXT(ki, next); 79 nxt = TAILQ_NEXT(ki, next);
80 if (!strcmp(ki->providername, name)) { 80 if (!strcmp(ki->providername, name)) {
81 TAILQ_REMOVE(&pkcs11_keylist, ki, next); 81 TAILQ_REMOVE(&pkcs11_keylist, ki, next);
82 xfree(ki->providername); 82 free(ki->providername);
83 key_free(ki->key); 83 key_free(ki->key);
84 free(ki); 84 free(ki);
85 } 85 }
@@ -130,15 +130,15 @@ process_add(void)
130 key_to_blob(keys[i], &blob, &blen); 130 key_to_blob(keys[i], &blob, &blen);
131 buffer_put_string(&msg, blob, blen); 131 buffer_put_string(&msg, blob, blen);
132 buffer_put_cstring(&msg, name); 132 buffer_put_cstring(&msg, name);
133 xfree(blob); 133 free(blob);
134 add_key(keys[i], name); 134 add_key(keys[i], name);
135 } 135 }
136 xfree(keys); 136 free(keys);
137 } else { 137 } else {
138 buffer_put_char(&msg, SSH_AGENT_FAILURE); 138 buffer_put_char(&msg, SSH_AGENT_FAILURE);
139 } 139 }
140 xfree(pin); 140 free(pin);
141 xfree(name); 141 free(name);
142 send_msg(&msg); 142 send_msg(&msg);
143 buffer_free(&msg); 143 buffer_free(&msg);
144} 144}
@@ -157,8 +157,8 @@ process_del(void)
157 buffer_put_char(&msg, SSH_AGENT_SUCCESS); 157 buffer_put_char(&msg, SSH_AGENT_SUCCESS);
158 else 158 else
159 buffer_put_char(&msg, SSH_AGENT_FAILURE); 159 buffer_put_char(&msg, SSH_AGENT_FAILURE);
160 xfree(pin); 160 free(pin);
161 xfree(name); 161 free(name);
162 send_msg(&msg); 162 send_msg(&msg);
163 buffer_free(&msg); 163 buffer_free(&msg);
164} 164}
@@ -195,10 +195,9 @@ process_sign(void)
195 } else { 195 } else {
196 buffer_put_char(&msg, SSH_AGENT_FAILURE); 196 buffer_put_char(&msg, SSH_AGENT_FAILURE);
197 } 197 }
198 xfree(data); 198 free(data);
199 xfree(blob); 199 free(blob);
200 if (signature != NULL) 200 free(signature);
201 xfree(signature);
202 send_msg(&msg); 201 send_msg(&msg);
203 buffer_free(&msg); 202 buffer_free(&msg);
204} 203}
@@ -274,7 +273,6 @@ main(int argc, char **argv)
274 LogLevel log_level = SYSLOG_LEVEL_ERROR; 273 LogLevel log_level = SYSLOG_LEVEL_ERROR;
275 char buf[4*4096]; 274 char buf[4*4096];
276 275
277 extern char *optarg;
278 extern char *__progname; 276 extern char *__progname;
279 277
280 TAILQ_INIT(&pkcs11_keylist); 278 TAILQ_INIT(&pkcs11_keylist);