projects
/
u
/
mdw
/
catacomb
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(from parent 1:
f7c19c5
)
key-attr.c (key_setkeydata): Decref after incref.
author
Mark Wooding
<mdw@distorted.org.uk>
Sun, 22 Jan 2012 12:56:34 +0000
(12:56 +0000)
committer
Mark Wooding
<mdw@distorted.org.uk>
Sun, 22 Jan 2012 13:06:18 +0000
(13:06 +0000)
Otherwise we'd crash if someone set the key data to be itself.
key-attr.c
patch
|
blob
|
blame
|
history
diff --git
a/key-attr.c
b/key-attr.c
index
ceec2ae
..
b6a3616
100644
(file)
--- a/
key-attr.c
+++ b/
key-attr.c
@@
-194,8
+194,8
@@
int key_setkeydata(key_file *kf, key *k, key_data *kd)
{
if (!(kf->f & KF_WRITE))
return (KERR_READONLY);
- key_drop(k->k);
key_incref(kd);
+ key_drop(k->k);
k->k = kd;
kf->f |= KF_MODIFIED;
return (0);