From 3ccd320bfd897976633aff55c269e2b16bcabb36 Mon Sep 17 00:00:00 2001 From: Joel Sing Date: Sat, 27 Mar 2010 16:20:30 +0000 Subject: Correctly initialise variable to prevent free without malloc in error path. Found by clang static analyser. --- sys/dev/softraid.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sys/dev') 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 * Copyright (c) 2008 Chris Kuethe @@ -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; -- cgit v1.2.3