From: Neil Brown Date: Mon, 26 May 2008 23:18:37 +0000 (+1000) Subject: Initialise newly allocated active_array better. X-Git-Tag: devel~25 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d52690acc48b3dcea1785d038fa12fc3de11d0a1;p=thirdparty%2Fmdadm.git Initialise newly allocated active_array better. Just set it all to zeros. ->devs in particular needs to be 0. --- diff --git a/managemon.c b/managemon.c index ae4ceb52..c7711040 100644 --- a/managemon.c +++ b/managemon.c @@ -203,6 +203,8 @@ static void manage_new(struct mdstat_ent *mdstat, new = malloc(sizeof(*new)); + memset(new, 0, sizeof(*new)); + new->devnum = mdstat->devnum; new->prev_state = new->curr_state = new->next_state = inactive;