projects
/
tinc
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e6497a2
)
fsck: Fix ed25519 public key reading, and fclose usage.
author
Vittorio G (VittGam)
<github@vittgam.net>
Tue, 11 Oct 2016 11:30:05 +0000
(13:30 +0200)
committer
GitHub
<noreply@github.com>
Tue, 11 Oct 2016 11:30:05 +0000
(13:30 +0200)
Signed-off-by: Vittorio Gambaletta <openwrt@vittgam.net>
src/fsck.c
patch
|
blob
|
history
diff --git
a/src/fsck.c
b/src/fsck.c
index
b90710b
..
e5e7dd5
100644
(file)
--- a/
src/fsck.c
+++ b/
src/fsck.c
@@
-297,9
+297,10
@@
int fsck(const char *argv0) {
rsa_t *rsa_pub = NULL;
f = fopen(fname, "r");
- if(f)
+ if(f)
{
rsa_pub = rsa_read_pem_public_key(f);
- fclose(f);
+ fclose(f);
+ }
if(rsa_priv) {
if(!rsa_pub) {
@@
-352,12
+353,12
@@
int fsck(const char *argv0) {
f = fopen(fname, "r");
if(f) {
ecdsa_pub = get_pubkey(f);
- if(!
f
) {
+ if(!
ecdsa_pub
) {
rewind(f);
ecdsa_pub = ecdsa_read_pem_public_key(f);
}
+ fclose(f);
}
- fclose(f);
if(ecdsa_priv) {
if(!ecdsa_pub) {