Commit f1d867c0 authored by Jeremy Huddleston's avatar Jeremy Huddleston

XQuartz: Silence clang static analyzer

Call to 'malloc' has an allocation size of 0 bytes.
Signed-off-by: default avatarJeremy Huddleston <jeremyhu@apple.com>
parent 913223e9
......@@ -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");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment