From 06ce4d5cf8371f2bc2e5f8223c2e64085799f470 Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Fri, 6 Jan 2012 00:35:56 -0800 Subject: Check the right return value for malloc failure Error detected by Solaris Studio 12.3 code analyzer: WARNING 1 (MRC): missing null-pointer check after malloc: calloc(((ullong)MaxFD),48) at: InitializeFD() Signed-off-by: Alan Coopersmith --- fd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'fd.c') diff --git a/fd.c b/fd.c index 8f824d6..3fa07d1 100644 --- a/fd.c +++ b/fd.c @@ -105,7 +105,7 @@ InitializeFD(void) panic("Can't allocate memory for file descriptor table"); } FDinfo = calloc(MaxFD, sizeof (struct fdinfo)); - if (FDD == NULL) { + if (FDinfo == NULL) { panic("Can't allocate memory for file descriptor info table"); } -- cgit v1.2.1