summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorJoel Sing <jsing@cvs.openbsd.org>2010-03-27 16:20:30 +0000
committerJoel Sing <jsing@cvs.openbsd.org>2010-03-27 16:20:30 +0000
commit3ccd320bfd897976633aff55c269e2b16bcabb36 (patch)
treed70f005e9011140cb3dd3902c51597345b115e53 /sys/dev
parent1aa870172f187fff36a6a7030b2e66e447098198 (diff)
Correctly initialise variable to prevent free without malloc in error path.
Found by clang static analyser.
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/softraid.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/dev/softraid.c b/sys/dev/softraid.c
index 202c1584601..ecfc135cc7c 100644
--- a/sys/dev/softraid.c
+++ b/sys/dev/softraid.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: softraid.c,v 1.197 2010/03/26 16:50:59 jsing Exp $ */
+/* $OpenBSD: softraid.c,v 1.198 2010/03/27 16:20:29 jsing Exp $ */
/*
* Copyright (c) 2007, 2008, 2009 Marco Peereboom <marco@peereboom.us>
* Copyright (c) 2008 Chris Kuethe <ckuethe@openbsd.org>
@@ -2297,7 +2297,7 @@ sr_hotspare(struct sr_softc *sc, dev_t dev)
struct sr_metadata *sm = NULL;
struct sr_meta_chunk *hm;
struct sr_chunk_head *cl;
- struct sr_chunk *hotspare, *chunk, *last;
+ struct sr_chunk *chunk, *last, *hotspare = NULL;
struct sr_uuid uuid;
struct disklabel label;
struct vnode *vn;