From 4e9d21862d0fbea7e028ff3a48a0b734440e6015 Mon Sep 17 00:00:00 2001 From: Artur Wojcik Date: Thu, 10 Dec 2009 12:03:39 -0700 Subject: [PATCH] Fix for NULL pointer dereference defect. Pointer 'st' returned from call to function 'malloc' at line 320 may be NULL and it will be dereferenced at line 321. Signed-off-by: Artur Wojcik Signed-off-by: Dan Williams --- super-intel.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/super-intel.c b/super-intel.c index cf6288f0..a2acaaf2 100644 --- a/super-intel.c +++ b/super-intel.c @@ -318,6 +318,8 @@ static struct supertype *match_metadata_desc_imsm(char *arg) return NULL; st = malloc(sizeof(*st)); + if (!st) + return NULL; memset(st, 0, sizeof(*st)); st->ss = &super_imsm; st->max_devs = IMSM_MAX_DEVICES; -- 2.47.2