summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2012-01-06 00:35:56 -0800
committerAlan Coopersmith <alan.coopersmith@oracle.com>2012-01-15 09:01:48 -0800
commit06ce4d5cf8371f2bc2e5f8223c2e64085799f470 (patch)
treef5a969687fcd152b4511876c6b4c24f1e9e687f1
parenta1c283e6f39117301319b60e261e9d1e22ea0d4d (diff)
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() <app/xscope/fd.c : 107> Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-rw-r--r--fd.c2
1 files changed, 1 insertions, 1 deletions
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");
}