XQuartz: Silence a clang static analysis warning about a possible memory leak on exit

stub.c:356:9: warning: Potential leak of memory pointed to by 'newargv'
        asl_log(aslc, NULL, ASL_LEVEL_ERR,
        ^~~~~~~
stub.c:356:9: warning: Potential leak of memory pointed to by 'newenvp'
        asl_log(aslc, NULL, ASL_LEVEL_ERR,
        ^~~~~~~
2 warnings generated.
Signed-off-by: Jeremy Huddleston Sequoia's avatarJeremy Huddleston Sequoia <jeremyhu@apple.com>
parent a03f096a
......@@ -353,6 +353,10 @@ main(int argc, char **argv, char **envp)
newenvp = (string_array_t)calloc((1 + envpc), sizeof(string_t));
if (!newargv || !newenvp) {
/* Silence the clang static analyzer */
free(newargv);
free(newenvp);
asl_log(aslc, NULL, ASL_LEVEL_ERR,
"Xquartz: Memory allocation failure");
return EXIT_FAILURE;
......
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