summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorJoel Sing <jsing@cvs.openbsd.org>2010-03-28 10:14:19 +0000
committerJoel Sing <jsing@cvs.openbsd.org>2010-03-28 10:14:19 +0000
commit50c2a3b2856b316c5bf031609dd8f449cc8cf04e (patch)
tree330ea9b9f95a00252e4abd9674e176d1cfbff766 /sys
parent5c253857a8725434265625f497e42bd8a02cc77e (diff)
Correctly initialise variables to prevent possible free without malloc in
error path. Found by jsg@ using the clang static analyser.
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/softraid_crypto.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/dev/softraid_crypto.c b/sys/dev/softraid_crypto.c
index 2dcf873874d..86df70f656f 100644
--- a/sys/dev/softraid_crypto.c
+++ b/sys/dev/softraid_crypto.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: softraid_crypto.c,v 1.48 2010/03/26 11:20:34 jsing Exp $ */
+/* $OpenBSD: softraid_crypto.c,v 1.49 2010/03/28 10:14:18 jsing Exp $ */
/*
* Copyright (c) 2007 Marco Peereboom <marco@peereboom.us>
* Copyright (c) 2008 Hans-Joerg Hoexer <hshoexer@openbsd.org>
@@ -560,7 +560,7 @@ sr_crypto_change_maskkey(struct sr_discipline *sd,
struct sr_crypto_kdfinfo *kdfinfo1, struct sr_crypto_kdfinfo *kdfinfo2)
{
u_char check_digest[SHA1_DIGEST_LENGTH];
- u_char *p, *c;
+ u_char *c, *p = NULL;
size_t ksz;
int rv = 1;
@@ -792,7 +792,7 @@ sr_crypto_read_key_disk(struct sr_discipline *sd, dev_t dev)
struct sr_meta_opt *om;
struct sr_chunk *key_disk = NULL;
struct disklabel label;
- struct vnode *vn;
+ struct vnode *vn = NULL;
char devname[32];
int c, part, open = 0;