summaryrefslogtreecommitdiff
path: root/usr.bin/ssh/key.c
diff options
context:
space:
mode:
authorDamien Miller <djm@cvs.openbsd.org>2006-03-20 11:38:47 +0000
committerDamien Miller <djm@cvs.openbsd.org>2006-03-20 11:38:47 +0000
commit8320803d13e4f1025dd8886d8b7d50f53337dc78 (patch)
tree1a7a10e893af9b954604fef24ea7c84458882cf4 /usr.bin/ssh/key.c
parent97a6df38bb41a7240f610c0ba5424d79ff95ad4d (diff)
(really) last of the Coverity diffs: avoid possible NULL deref in
key_free. via elad AT netbsd.org; markus@ ok
Diffstat (limited to 'usr.bin/ssh/key.c')
-rw-r--r--usr.bin/ssh/key.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/usr.bin/ssh/key.c b/usr.bin/ssh/key.c
index 5cb54c13b71..283aea99ebd 100644
--- a/usr.bin/ssh/key.c
+++ b/usr.bin/ssh/key.c
@@ -122,6 +122,8 @@ key_new_private(int type)
void
key_free(Key *k)
{
+ if (k == NULL)
+ fatal("key_free: key is NULL);
switch (k->type) {
case KEY_RSA1:
case KEY_RSA: