diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2012-01-06 00:35:56 -0800 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2012-01-15 09:01:48 -0800 |
commit | 06ce4d5cf8371f2bc2e5f8223c2e64085799f470 (patch) | |
tree | f5a969687fcd152b4511876c6b4c24f1e9e687f1 | |
parent | a1c283e6f39117301319b60e261e9d1e22ea0d4d (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.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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"); } |