From: Jes Sorensen <Jes.Sorensen@xxxxxxxxxx> Signed-off-by: Jes Sorensen <Jes.Sorensen@xxxxxxxxxx> --- Monitor.c | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-) diff --git a/Monitor.c b/Monitor.c index 101bca4..675ec00 100644 --- a/Monitor.c +++ b/Monitor.c @@ -177,6 +177,13 @@ int Monitor(struct mddev_dev *devlist, st->devname = strdup(mdlist->devname); else { st->devname = malloc(8+strlen(mdlist->devname)+1); + /* + * Treat malloc() failure the same as above + */ + if (!st->devname) { + free(st); + continue; + } strcpy(strcpy(st->devname, "/dev/md/"), mdlist->devname); } -- 1.7.6.4 -- To unsubscribe from this list: send the line "unsubscribe linux-raid" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html