chiark
/
gitweb
/
~ianmdlvl
/
secnet.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
92f10bb
)
privcache: Regularise error handling in missing defhash case
author
Ian Jackson
<ijackson@chiark.greenend.org.uk>
Sat, 7 Dec 2019 14:49:50 +0000
(14:49 +0000)
committer
Ian Jackson
<ijackson@chiark.greenend.org.uk>
Sat, 15 Feb 2020 21:56:54 +0000
(21:56 +0000)
Now it is clearer to see that we don't leak sigpriv;
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
privcache.c
patch
|
blob
|
history
diff --git
a/privcache.c
b/privcache.c
index c01af9dbc412cbc218256ac01e3919fb8066a1a5..c8a9a7f2a92a25fc8461e3fa5e196ce9dd3edd02 100644
(file)
--- a/
privcache.c
+++ b/
privcache.c
@@
-118,8
+118,6
@@
static struct sigprivkey_if *uncached_load_file(
slilog(log,M_ERR,
"private key %s requires `hash' config key for privcache to load",
path);
- sigpriv->dispose(sigpriv->st);
- sigpriv=0;
goto error_out;
}
sigpriv->sethash(sigpriv->st,defhash);
@@
-130,6
+128,7
@@
static struct sigprivkey_if *uncached_load_file(
return ok ? sigpriv : 0;
error_out:
+ if (sigpriv) sigpriv->dispose(sigpriv->st);
ok=False;
goto out;
}