projects
/
u
/
mdw
/
putty
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Support for Windows PuTTY connecting straight to a local serial port
[u/mdw/putty]
/
sshpubk.c
diff --git
a/sshpubk.c
b/sshpubk.c
index
fddc6e5
..
812a8e9
100644
(file)
--- a/
sshpubk.c
+++ b/
sshpubk.c
@@
-71,11
+71,6
@@
static int loadrsakey_main(FILE * fp, struct RSAKey *key, int pub_only,
if (i < 0)
goto end; /* overran */
if (i < 0)
goto end; /* overran */
- if (pub_only) {
- ret = 1;
- goto end;
- }
-
/* Next, the comment field. */
j = GET_32BIT(buf + i);
i += 4;
/* Next, the comment field. */
j = GET_32BIT(buf + i);
i += 4;
@@
-88,9
+83,17
@@
static int loadrsakey_main(FILE * fp, struct RSAKey *key, int pub_only,
}
i += j;
if (commentptr)
}
i += j;
if (commentptr)
- *commentptr =
comment
;
+ *commentptr =
dupstr(comment)
;
if (key)
key->comment = comment;
if (key)
key->comment = comment;
+ else
+ sfree(comment);
+
+ if (pub_only) {
+ ret = 1;
+ goto end;
+ }
+
if (!key) {
ret = ciphertype != 0;
*error = NULL;
if (!key) {
ret = ciphertype != 0;
*error = NULL;