From: Jes Sorensen <Jes.Sorensen@xxxxxxxxxx> Signed-off-by: Jes Sorensen <Jes.Sorensen@xxxxxxxxxx> --- mdstat.c | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/mdstat.c b/mdstat.c index abf6bf9..346a1e8 100644 --- a/mdstat.c +++ b/mdstat.c @@ -104,6 +104,11 @@ static int add_member_devname(struct dev_member **m, char *name) return 0; new = malloc(sizeof(*new)); + if (!new) { + fprintf(stderr, Name ": %s unable to allocate memory\n", + __func__); + return 0; + } new->name = strndup(name, t - name); new->next = *m; *m = new; -- 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