XQuartz: Silence clang static analyzer

Call to 'malloc' has an allocation size of 0 bytes.

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
This commit is contained in:
Jeremy Huddleston 2011-04-23 23:22:27 -07:00
parent 913223e9dd
commit f1d867c0a1

View File

@ -300,8 +300,8 @@ int main(int argc, char **argv, char **envp) {
/* We have fixed-size string lengths due to limitations in IPC,
* so we need to copy our argv and envp.
*/
newargv = (string_array_t)malloc(argc * sizeof(string_t));
newenvp = (string_array_t)malloc(envpc * sizeof(string_t));
newargv = (string_array_t)calloc((1 + argc), sizeof(string_t));
newenvp = (string_array_t)calloc((1 + envpc), sizeof(string_t));
if(!newargv || !newenvp) {
fprintf(stderr, "Xquartz: Memory allocation failure\n");