diff options
Diffstat (limited to 'key.c')
-rw-r--r-- | key.c | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -32,7 +32,7 @@ | |||
32 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 32 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
33 | */ | 33 | */ |
34 | #include "includes.h" | 34 | #include "includes.h" |
35 | RCSID("$OpenBSD: key.c,v 1.33 2001/10/04 14:34:16 markus Exp $"); | 35 | RCSID("$OpenBSD: key.c,v 1.34 2001/11/21 15:51:24 markus Exp $"); |
36 | 36 | ||
37 | #include <openssl/evp.h> | 37 | #include <openssl/evp.h> |
38 | 38 | ||
@@ -420,14 +420,15 @@ key_read(Key *ret, char **cpp) | |||
420 | n = uudecode(cp, blob, len); | 420 | n = uudecode(cp, blob, len); |
421 | if (n < 0) { | 421 | if (n < 0) { |
422 | error("key_read: uudecode %s failed", cp); | 422 | error("key_read: uudecode %s failed", cp); |
423 | xfree(blob); | ||
423 | return -1; | 424 | return -1; |
424 | } | 425 | } |
425 | k = key_from_blob(blob, n); | 426 | k = key_from_blob(blob, n); |
427 | xfree(blob); | ||
426 | if (k == NULL) { | 428 | if (k == NULL) { |
427 | error("key_read: key_from_blob %s failed", cp); | 429 | error("key_read: key_from_blob %s failed", cp); |
428 | return -1; | 430 | return -1; |
429 | } | 431 | } |
430 | xfree(blob); | ||
431 | if (k->type != type) { | 432 | if (k->type != type) { |
432 | error("key_read: type mismatch: encoding error"); | 433 | error("key_read: type mismatch: encoding error"); |
433 | key_free(k); | 434 | key_free(k); |
@@ -454,9 +455,9 @@ key_read(Key *ret, char **cpp) | |||
454 | #endif | 455 | #endif |
455 | } | 456 | } |
456 | /*XXXX*/ | 457 | /*XXXX*/ |
458 | key_free(k); | ||
457 | if (success != 1) | 459 | if (success != 1) |
458 | break; | 460 | break; |
459 | key_free(k); | ||
460 | /* advance cp: skip whitespace and data */ | 461 | /* advance cp: skip whitespace and data */ |
461 | while (*cp == ' ' || *cp == '\t') | 462 | while (*cp == ' ' || *cp == '\t') |
462 | cp++; | 463 | cp++; |