From: Neil Brown Date: Thu, 15 May 2008 05:50:42 +0000 (+1000) Subject: Avoid possible null dereference in Assemble. X-Git-Tag: mdadm-2.6.5~7 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ddd1a492519d61587cdd92660b875b82f4832176;p=thirdparty%2Fmdadm.git Avoid possible null dereference in Assemble. If the first device we look at has no superblock, there is no 'st' to free, so don't free it. --- diff --git a/Assemble.c b/Assemble.c index c7cc385d..86212032 100644 --- a/Assemble.c +++ b/Assemble.c @@ -315,7 +315,8 @@ int Assemble(struct supertype *st, char *mddev, int mdfd, if (!tst || !tst->sb) { fprintf(stderr, Name ": %s has no superblock - assembly aborted\n", devname); - st->ss->free_super(st); + if (st) + st->ss->free_super(st); return 1; }