X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;f=sshpubk.c;h=1a27c313974506ec4fd9e6051b47e3f414a87c97;hb=359b5c8eb45ff56c62032cf147fcdb3723d54324;hp=30f9e4b331c78b2121c131d59134dbc595c7a282;hpb=870ad6ab0780c68e0e71d1a14d394aa543a8b89e;p=PuTTY.git diff --git a/sshpubk.c b/sshpubk.c index 30f9e4b3..1a27c313 100644 --- a/sshpubk.c +++ b/sshpubk.c @@ -309,6 +309,8 @@ int rsakey_pubblob(const Filename *filename, void **blob, int *bloblen, *commentptr = commentp ? dupstr(commentp) : NULL; *blob = rsa_public_blob(&key, bloblen); freersakey(&key); + sfree(line); + fclose(fp); return 1; not_public_either: @@ -944,6 +946,7 @@ unsigned char *rfc4716_loadpub(FILE *fp, char **algorithm, } *q = '\0'; + sfree(comment); /* *just* in case of multiple Comment headers */ comment = dupstr(line); } else if (!strcmp(line, "Subject") || !strncmp(line, "x-", 2)) { @@ -1089,6 +1092,7 @@ unsigned char *openssh_loadpub(FILE *fp, char **algorithm, *commentptr = comment; else sfree(comment); + sfree(line); return pubblob; error: @@ -1308,7 +1312,7 @@ int ssh2_save_userkey(const Filename *filename, struct ssh2_userkey *key, int passlen; int cipherblk; int i; - char *cipherstr; + const char *cipherstr; unsigned char priv_mac[20]; /* @@ -1688,7 +1692,7 @@ int key_type(const Filename *filename) * Convert the type word to a string, for `wrong type' error * messages. */ -char *key_type_to_str(int type) +const char *key_type_to_str(int type) { switch (type) { case SSH_KEYTYPE_UNOPENABLE: return "unable to open file"; break;