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 <jeremyhu@apple.com>
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user