thread.c:60:15 error: dereference of possibly-NULL 'wrap' in thread_wrap()
Job #3396030 failed for 0d9e27dd:
thread.c: In function 'thread_wrap':
thread.c:60:15: error: dereference of possibly-NULL 'wrap' [CWE-690] [-Werror=analyzer-possible-null-dereference]
60 | *wrap = (struct thread_wrap){
| ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
61 | .func = func,
| ~~~~~~~~~~~~~
62 | .arg = arg,
| ~~~~~~~~~~~
63 | };
| ~
'thread_wrap': events 1-2
|
| 59 | struct thread_wrap *wrap = malloc(sizeof(*wrap));
| | ^~~~~~~~~~~~~~~~~~~~~
| | |
| | (1) this call could return NULL
| 60 | *wrap = (struct thread_wrap){
| | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| | |
| | (2) 'wrap' could be NULL: unchecked value from (1)
| 61 | .func = func,
| | ~~~~~~~~~~~~~
| 62 | .arg = arg,
| | ~~~~~~~~~~~
| 63 | };
| | ~
|
This is because in 7d1ceaf3 the RUNTIME_CHECK(wrap != NULL);
was dropped.