freeglut-3.8.0-1.fc44

List of Findings

Error: COMPILER_WARNING (CWE-252): [#def1]
freeglut-3.8.0/progs/demos/CallbackMaker/CallbackMaker.c: scope_hint: In function ‘Error’
freeglut-3.8.0/progs/demos/CallbackMaker/CallbackMaker.c:239:5: warning[-Wunused-result]: ignoring return value of ‘fgets’ declared with attribute ‘warn_unused_result’
#  239 |     fgets ( dummy_string, STRING_LENGTH, stdin );
#      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  237|       /* terminate program, after pause for input so user can see */
#  238|       printf ( "Please enter something to exit: " );
#  239|->     fgets ( dummy_string, STRING_LENGTH, stdin );
#  240|   
#  241|       /* Call exit directly as freeglut is messed

Error: COMPILER_WARNING (CWE-252): [#def2]
freeglut-3.8.0/progs/demos/CallbackMaker/CallbackMaker.c: scope_hint: In function ‘main’
freeglut-3.8.0/progs/demos/CallbackMaker/CallbackMaker.c:733:3: warning[-Wunused-result]: ignoring return value of ‘fgets’ declared with attribute ‘warn_unused_result’
#  733 |   fgets ( dummy_string, STRING_LENGTH, stdin );
#      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  731|   
#  732|     printf ( "Please enter something to continue: " );
#  733|->   fgets ( dummy_string, STRING_LENGTH, stdin );
#  734|   
#  735|     glutMainLoop();

Error: GCC_ANALYZER_WARNING (CWE-775): [#def3]
freeglut-3.8.0/progs/demos/Fractals/fractals.c:255:29: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(fnme, "rt")’
freeglut-3.8.0/progs/demos/Fractals/fractals.c:225:6: enter_function: entry to ‘readConfigFile’
freeglut-3.8.0/progs/demos/Fractals/fractals.c:227:16: acquire_resource: opened here
freeglut-3.8.0/progs/demos/Fractals/fractals.c:231:6: branch_true: following ‘true’ branch...
freeglut-3.8.0/progs/demos/Fractals/fractals.c:234:5: branch_true: ...to here
freeglut-3.8.0/progs/demos/Fractals/fractals.c:234:5: call_function: calling ‘checkedFGets’ from ‘readConfigFile’
freeglut-3.8.0/progs/demos/Fractals/fractals.c:234:5: return_function: returning to ‘readConfigFile’ from ‘checkedFGets’
freeglut-3.8.0/progs/demos/Fractals/fractals.c:237:5: call_function: calling ‘checkedFGets’ from ‘readConfigFile’
freeglut-3.8.0/progs/demos/Fractals/fractals.c:237:5: return_function: returning to ‘readConfigFile’ from ‘checkedFGets’
freeglut-3.8.0/progs/demos/Fractals/fractals.c:240:5: call_function: calling ‘checkedFGets’ from ‘readConfigFile’
freeglut-3.8.0/progs/demos/Fractals/fractals.c:240:5: return_function: returning to ‘readConfigFile’ from ‘checkedFGets’
freeglut-3.8.0/progs/demos/Fractals/fractals.c:249:5: call_function: calling ‘checkedFGets’ from ‘readConfigFile’
freeglut-3.8.0/progs/demos/Fractals/fractals.c:249:5: return_function: returning to ‘readConfigFile’ from ‘checkedFGets’
freeglut-3.8.0/progs/demos/Fractals/fractals.c:252:5: call_function: calling ‘checkedFGets’ from ‘readConfigFile’
freeglut-3.8.0/progs/demos/Fractals/fractals.c:252:5: return_function: returning to ‘readConfigFile’ from ‘checkedFGets’
freeglut-3.8.0/progs/demos/Fractals/fractals.c:258:5: call_function: calling ‘checkedFGets’ from ‘readConfigFile’
freeglut-3.8.0/progs/demos/Fractals/fractals.c:258:5: return_function: returning to ‘readConfigFile’ from ‘checkedFGets’
freeglut-3.8.0/progs/demos/Fractals/fractals.c:255:29: danger: ‘fopen(fnme, "rt")’ leaks here; was opened at [(2)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/1)
#  253|       sscanf ( inputline, "%d", &num_trans ) ;
#  254|   
#  255|->     affine = (AffineTrans *)malloc ( num_trans * sizeof(AffineTrans) ) ;
#  256|   
#  257|       /* Read a comment line */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def4]
freeglut-3.8.0/progs/demos/Fractals/fractals.c:255:29: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(fnme, "rt")’
freeglut-3.8.0/progs/demos/Fractals/fractals.c:225:6: enter_function: entry to ‘readConfigFile’
freeglut-3.8.0/progs/demos/Fractals/fractals.c:227:16: acquire_memory: allocated here
freeglut-3.8.0/progs/demos/Fractals/fractals.c:231:6: branch_true: following ‘true’ branch...
freeglut-3.8.0/progs/demos/Fractals/fractals.c:234:5: branch_true: ...to here
freeglut-3.8.0/progs/demos/Fractals/fractals.c:234:5: call_function: calling ‘checkedFGets’ from ‘readConfigFile’
freeglut-3.8.0/progs/demos/Fractals/fractals.c:234:5: return_function: returning to ‘readConfigFile’ from ‘checkedFGets’
freeglut-3.8.0/progs/demos/Fractals/fractals.c:237:5: call_function: calling ‘checkedFGets’ from ‘readConfigFile’
freeglut-3.8.0/progs/demos/Fractals/fractals.c:237:5: return_function: returning to ‘readConfigFile’ from ‘checkedFGets’
freeglut-3.8.0/progs/demos/Fractals/fractals.c:240:5: call_function: calling ‘checkedFGets’ from ‘readConfigFile’
freeglut-3.8.0/progs/demos/Fractals/fractals.c:240:5: return_function: returning to ‘readConfigFile’ from ‘checkedFGets’
freeglut-3.8.0/progs/demos/Fractals/fractals.c:249:5: call_function: calling ‘checkedFGets’ from ‘readConfigFile’
freeglut-3.8.0/progs/demos/Fractals/fractals.c:249:5: return_function: returning to ‘readConfigFile’ from ‘checkedFGets’
freeglut-3.8.0/progs/demos/Fractals/fractals.c:252:5: call_function: calling ‘checkedFGets’ from ‘readConfigFile’
freeglut-3.8.0/progs/demos/Fractals/fractals.c:252:5: return_function: returning to ‘readConfigFile’ from ‘checkedFGets’
freeglut-3.8.0/progs/demos/Fractals/fractals.c:258:5: call_function: calling ‘checkedFGets’ from ‘readConfigFile’
freeglut-3.8.0/progs/demos/Fractals/fractals.c:258:5: return_function: returning to ‘readConfigFile’ from ‘checkedFGets’
freeglut-3.8.0/progs/demos/Fractals/fractals.c:255:29: danger: ‘fopen(fnme, "rt")’ leaks here; was allocated at [(2)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/1)
#  253|       sscanf ( inputline, "%d", &num_trans ) ;
#  254|   
#  255|->     affine = (AffineTrans *)malloc ( num_trans * sizeof(AffineTrans) ) ;
#  256|   
#  257|       /* Read a comment line */

Error: CPPCHECK_WARNING (CWE-476): [#def5]
freeglut-3.8.0/progs/demos/Fractals/fractals.c:274: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: affine
#  272|       num_trans = 4 ;
#  273|       affine = (AffineTrans *)malloc ( num_trans * sizeof(AffineTrans) ) ;
#  274|->     affine[0].a00 = 1/3. ;  affine[0].a01 = 0.00 ;  affine[0].a10 = 0.00 ;  affine[0].a11 = 1/3. ;
#  275|       affine[0].b0 = 0.0 ;    affine[0].b1 = 0.0 ;
#  276|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def6]
freeglut-3.8.0/progs/demos/Fractals/fractals.c:274:5: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘affine’
freeglut-3.8.0/progs/demos/Fractals/fractals.c:231:6: branch_false: following ‘false’ branch...
freeglut-3.8.0/progs/demos/Fractals/fractals.c:270:5: branch_false: ...to here
freeglut-3.8.0/progs/demos/Fractals/fractals.c:273:29: acquire_memory: this call could return NULL
freeglut-3.8.0/progs/demos/Fractals/fractals.c:274:5: danger: ‘malloc(256)’ could be NULL: unchecked value from [(3)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/2)
#  272|       num_trans = 4 ;
#  273|       affine = (AffineTrans *)malloc ( num_trans * sizeof(AffineTrans) ) ;
#  274|->     affine[0].a00 = 1/3. ;  affine[0].a01 = 0.00 ;  affine[0].a10 = 0.00 ;  affine[0].a11 = 1/3. ;
#  275|       affine[0].b0 = 0.0 ;    affine[0].b1 = 0.0 ;
#  276|   

Error: CPPCHECK_WARNING (CWE-476): [#def7]
freeglut-3.8.0/progs/demos/Fractals/fractals.c:275: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: affine
#  273|       affine = (AffineTrans *)malloc ( num_trans * sizeof(AffineTrans) ) ;
#  274|       affine[0].a00 = 1/3. ;  affine[0].a01 = 0.00 ;  affine[0].a10 = 0.00 ;  affine[0].a11 = 1/3. ;
#  275|->     affine[0].b0 = 0.0 ;    affine[0].b1 = 0.0 ;
#  276|   
#  277|       affine[1].a00 = 1/6. ;  affine[1].a01 = -1/3.*sin(FGH_PI/3.) ;   affine[1].a10 = 1/3.*sin(FGH_PI/3.) ;   affine[1].a11 = 1/6. ;

Error: CPPCHECK_WARNING (CWE-476): [#def8]
freeglut-3.8.0/progs/demos/Fractals/fractals.c:277: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: affine
#  275|       affine[0].b0 = 0.0 ;    affine[0].b1 = 0.0 ;
#  276|   
#  277|->     affine[1].a00 = 1/6. ;  affine[1].a01 = -1/3.*sin(FGH_PI/3.) ;   affine[1].a10 = 1/3.*sin(FGH_PI/3.) ;   affine[1].a11 = 1/6. ;
#  278|       affine[1].b0 = 1/3. ;   affine[1].b1 = 0.0 ;
#  279|   

Error: CPPCHECK_WARNING (CWE-476): [#def9]
freeglut-3.8.0/progs/demos/Fractals/fractals.c:278: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: affine
#  276|   
#  277|       affine[1].a00 = 1/6. ;  affine[1].a01 = -1/3.*sin(FGH_PI/3.) ;   affine[1].a10 = 1/3.*sin(FGH_PI/3.) ;   affine[1].a11 = 1/6. ;
#  278|->     affine[1].b0 = 1/3. ;   affine[1].b1 = 0.0 ;
#  279|   
#  280|       affine[2].a00 = 1/6. ;  affine[2].a01 = -1/3.*sin(-FGH_PI/3.) ;  affine[2].a10 = 1/3.*sin(-FGH_PI/3.) ;  affine[2].a11 = 1/6. ;

Error: CPPCHECK_WARNING (CWE-476): [#def10]
freeglut-3.8.0/progs/demos/Fractals/fractals.c:280: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: affine
#  278|       affine[1].b0 = 1/3. ;   affine[1].b1 = 0.0 ;
#  279|   
#  280|->     affine[2].a00 = 1/6. ;  affine[2].a01 = -1/3.*sin(-FGH_PI/3.) ;  affine[2].a10 = 1/3.*sin(-FGH_PI/3.) ;  affine[2].a11 = 1/6. ;
#  281|       affine[2].b0 = 0.5 ;    affine[2].b1 = sqrt(3)/6. ;
#  282|   

Error: CPPCHECK_WARNING (CWE-476): [#def11]
freeglut-3.8.0/progs/demos/Fractals/fractals.c:281: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: affine
#  279|   
#  280|       affine[2].a00 = 1/6. ;  affine[2].a01 = -1/3.*sin(-FGH_PI/3.) ;  affine[2].a10 = 1/3.*sin(-FGH_PI/3.) ;  affine[2].a11 = 1/6. ;
#  281|->     affine[2].b0 = 0.5 ;    affine[2].b1 = sqrt(3)/6. ;
#  282|   
#  283|       affine[3].a00 = 1/3. ;  affine[3].a01 = 0.00 ;  affine[3].a10 = 0.00 ;  affine[3].a11 = 1/3. ;

Error: CPPCHECK_WARNING (CWE-476): [#def12]
freeglut-3.8.0/progs/demos/Fractals/fractals.c:283: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: affine
#  281|       affine[2].b0 = 0.5 ;    affine[2].b1 = sqrt(3)/6. ;
#  282|   
#  283|->     affine[3].a00 = 1/3. ;  affine[3].a01 = 0.00 ;  affine[3].a10 = 0.00 ;  affine[3].a11 = 1/3. ;
#  284|       affine[3].b0 = 2/3. ;   affine[3].b1 = 0.0 ;
#  285|     }

Error: CPPCHECK_WARNING (CWE-476): [#def13]
freeglut-3.8.0/progs/demos/Fractals/fractals.c:284: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: affine
#  282|   
#  283|       affine[3].a00 = 1/3. ;  affine[3].a01 = 0.00 ;  affine[3].a10 = 0.00 ;  affine[3].a11 = 1/3. ;
#  284|->     affine[3].b0 = 2/3. ;   affine[3].b1 = 0.0 ;
#  285|     }
#  286|   

Error: CPPCHECK_WARNING (CWE-476): [#def14]
freeglut-3.8.0/progs/demos/Fractals/fractals.c:294: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: affine
#  292|       /* Calculate the stationary point */
#  293|   
#  294|->     m00 = 1.0 - affine[i].a00 ;
#  295|       m01 =     - affine[i].a01 ;
#  296|       m10 =     - affine[i].a10 ;

Error: CPPCHECK_WARNING (CWE-476): [#def15]
freeglut-3.8.0/progs/demos/Fractals/fractals.c:295: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: affine
#  293|   
#  294|       m00 = 1.0 - affine[i].a00 ;
#  295|->     m01 =     - affine[i].a01 ;
#  296|       m10 =     - affine[i].a10 ;
#  297|       m11 = 1.0 - affine[i].a11 ;

Error: CPPCHECK_WARNING (CWE-476): [#def16]
freeglut-3.8.0/progs/demos/Fractals/fractals.c:296: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: affine
#  294|       m00 = 1.0 - affine[i].a00 ;
#  295|       m01 =     - affine[i].a01 ;
#  296|->     m10 =     - affine[i].a10 ;
#  297|       m11 = 1.0 - affine[i].a11 ;
#  298|   

Error: CPPCHECK_WARNING (CWE-476): [#def17]
freeglut-3.8.0/progs/demos/Fractals/fractals.c:297: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: affine
#  295|       m01 =     - affine[i].a01 ;
#  296|       m10 =     - affine[i].a10 ;
#  297|->     m11 = 1.0 - affine[i].a11 ;
#  298|   
#  299|       determ = m00 * m11 - m01 * m10 ;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def18]
freeglut-3.8.0/progs/demos/Fractals_random/fractals_random.c:299:29: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(fnme, "rt")’
freeglut-3.8.0/progs/demos/Fractals_random/fractals_random.c:269:6: enter_function: entry to ‘readConfigFile’
freeglut-3.8.0/progs/demos/Fractals_random/fractals_random.c:271:16: acquire_resource: opened here
freeglut-3.8.0/progs/demos/Fractals_random/fractals_random.c:275:6: branch_true: following ‘true’ branch...
freeglut-3.8.0/progs/demos/Fractals_random/fractals_random.c:278:5: branch_true: ...to here
freeglut-3.8.0/progs/demos/Fractals_random/fractals_random.c:278:5: call_function: calling ‘checkedFGets’ from ‘readConfigFile’
freeglut-3.8.0/progs/demos/Fractals_random/fractals_random.c:278:5: return_function: returning to ‘readConfigFile’ from ‘checkedFGets’
freeglut-3.8.0/progs/demos/Fractals_random/fractals_random.c:281:5: call_function: calling ‘checkedFGets’ from ‘readConfigFile’
freeglut-3.8.0/progs/demos/Fractals_random/fractals_random.c:281:5: return_function: returning to ‘readConfigFile’ from ‘checkedFGets’
freeglut-3.8.0/progs/demos/Fractals_random/fractals_random.c:284:5: call_function: calling ‘checkedFGets’ from ‘readConfigFile’
freeglut-3.8.0/progs/demos/Fractals_random/fractals_random.c:284:5: return_function: returning to ‘readConfigFile’ from ‘checkedFGets’
freeglut-3.8.0/progs/demos/Fractals_random/fractals_random.c:293:5: call_function: calling ‘checkedFGets’ from ‘readConfigFile’
freeglut-3.8.0/progs/demos/Fractals_random/fractals_random.c:293:5: return_function: returning to ‘readConfigFile’ from ‘checkedFGets’
freeglut-3.8.0/progs/demos/Fractals_random/fractals_random.c:296:5: call_function: calling ‘checkedFGets’ from ‘readConfigFile’
freeglut-3.8.0/progs/demos/Fractals_random/fractals_random.c:296:5: return_function: returning to ‘readConfigFile’ from ‘checkedFGets’
freeglut-3.8.0/progs/demos/Fractals_random/fractals_random.c:302:5: call_function: calling ‘checkedFGets’ from ‘readConfigFile’
freeglut-3.8.0/progs/demos/Fractals_random/fractals_random.c:302:5: return_function: returning to ‘readConfigFile’ from ‘checkedFGets’
freeglut-3.8.0/progs/demos/Fractals_random/fractals_random.c:299:29: danger: ‘fopen(fnme, "rt")’ leaks here; was opened at [(2)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/1)
#  297|       sscanf ( inputline, "%d", &num_trans ) ;
#  298|   
#  299|->     affine = (AffineTrans *)malloc ( num_trans * sizeof(AffineTrans) ) ;
#  300|   
#  301|       /* Read a comment line */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def19]
freeglut-3.8.0/progs/demos/Fractals_random/fractals_random.c:299:29: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(fnme, "rt")’
freeglut-3.8.0/progs/demos/Fractals_random/fractals_random.c:269:6: enter_function: entry to ‘readConfigFile’
freeglut-3.8.0/progs/demos/Fractals_random/fractals_random.c:271:16: acquire_memory: allocated here
freeglut-3.8.0/progs/demos/Fractals_random/fractals_random.c:275:6: branch_true: following ‘true’ branch...
freeglut-3.8.0/progs/demos/Fractals_random/fractals_random.c:278:5: branch_true: ...to here
freeglut-3.8.0/progs/demos/Fractals_random/fractals_random.c:278:5: call_function: calling ‘checkedFGets’ from ‘readConfigFile’
freeglut-3.8.0/progs/demos/Fractals_random/fractals_random.c:278:5: return_function: returning to ‘readConfigFile’ from ‘checkedFGets’
freeglut-3.8.0/progs/demos/Fractals_random/fractals_random.c:281:5: call_function: calling ‘checkedFGets’ from ‘readConfigFile’
freeglut-3.8.0/progs/demos/Fractals_random/fractals_random.c:281:5: return_function: returning to ‘readConfigFile’ from ‘checkedFGets’
freeglut-3.8.0/progs/demos/Fractals_random/fractals_random.c:284:5: call_function: calling ‘checkedFGets’ from ‘readConfigFile’
freeglut-3.8.0/progs/demos/Fractals_random/fractals_random.c:284:5: return_function: returning to ‘readConfigFile’ from ‘checkedFGets’
freeglut-3.8.0/progs/demos/Fractals_random/fractals_random.c:293:5: call_function: calling ‘checkedFGets’ from ‘readConfigFile’
freeglut-3.8.0/progs/demos/Fractals_random/fractals_random.c:293:5: return_function: returning to ‘readConfigFile’ from ‘checkedFGets’
freeglut-3.8.0/progs/demos/Fractals_random/fractals_random.c:296:5: call_function: calling ‘checkedFGets’ from ‘readConfigFile’
freeglut-3.8.0/progs/demos/Fractals_random/fractals_random.c:296:5: return_function: returning to ‘readConfigFile’ from ‘checkedFGets’
freeglut-3.8.0/progs/demos/Fractals_random/fractals_random.c:302:5: call_function: calling ‘checkedFGets’ from ‘readConfigFile’
freeglut-3.8.0/progs/demos/Fractals_random/fractals_random.c:302:5: return_function: returning to ‘readConfigFile’ from ‘checkedFGets’
freeglut-3.8.0/progs/demos/Fractals_random/fractals_random.c:299:29: danger: ‘fopen(fnme, "rt")’ leaks here; was allocated at [(2)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/1)
#  297|       sscanf ( inputline, "%d", &num_trans ) ;
#  298|   
#  299|->     affine = (AffineTrans *)malloc ( num_trans * sizeof(AffineTrans) ) ;
#  300|   
#  301|       /* Read a comment line */

Error: CPPCHECK_WARNING (CWE-476): [#def20]
freeglut-3.8.0/progs/demos/Fractals_random/fractals_random.c:318: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: affine
#  316|       num_trans = 4 ;
#  317|       affine = (AffineTrans *)malloc ( num_trans * sizeof(AffineTrans) ) ;
#  318|->     affine[0].a00 = 1/3. ;  affine[0].a01 = 0.00 ;  affine[0].a10 = 0.00 ;  affine[0].a11 = 1/3. ;
#  319|       affine[0].b0 = 0.0 ;    affine[0].b1 = 0.0 ;
#  320|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def21]
freeglut-3.8.0/progs/demos/Fractals_random/fractals_random.c:318:5: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘affine’
freeglut-3.8.0/progs/demos/Fractals_random/fractals_random.c:275:6: branch_false: following ‘false’ branch...
freeglut-3.8.0/progs/demos/Fractals_random/fractals_random.c:314:5: branch_false: ...to here
freeglut-3.8.0/progs/demos/Fractals_random/fractals_random.c:317:29: acquire_memory: this call could return NULL
freeglut-3.8.0/progs/demos/Fractals_random/fractals_random.c:318:5: danger: ‘malloc(256)’ could be NULL: unchecked value from [(3)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/2)
#  316|       num_trans = 4 ;
#  317|       affine = (AffineTrans *)malloc ( num_trans * sizeof(AffineTrans) ) ;
#  318|->     affine[0].a00 = 1/3. ;  affine[0].a01 = 0.00 ;  affine[0].a10 = 0.00 ;  affine[0].a11 = 1/3. ;
#  319|       affine[0].b0 = 0.0 ;    affine[0].b1 = 0.0 ;
#  320|   

Error: CPPCHECK_WARNING (CWE-476): [#def22]
freeglut-3.8.0/progs/demos/Fractals_random/fractals_random.c:319: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: affine
#  317|       affine = (AffineTrans *)malloc ( num_trans * sizeof(AffineTrans) ) ;
#  318|       affine[0].a00 = 1/3. ;  affine[0].a01 = 0.00 ;  affine[0].a10 = 0.00 ;  affine[0].a11 = 1/3. ;
#  319|->     affine[0].b0 = 0.0 ;    affine[0].b1 = 0.0 ;
#  320|   
#  321|       affine[1].a00 = 1/6. ;  affine[1].a01 = -1/3.*sin(FGH_PI/3.) ;   affine[1].a10 = 1/3.*sin(FGH_PI/3.) ;   affine[1].a11 = 1/6. ;

Error: CPPCHECK_WARNING (CWE-476): [#def23]
freeglut-3.8.0/progs/demos/Fractals_random/fractals_random.c:321: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: affine
#  319|       affine[0].b0 = 0.0 ;    affine[0].b1 = 0.0 ;
#  320|   
#  321|->     affine[1].a00 = 1/6. ;  affine[1].a01 = -1/3.*sin(FGH_PI/3.) ;   affine[1].a10 = 1/3.*sin(FGH_PI/3.) ;   affine[1].a11 = 1/6. ;
#  322|       affine[1].b0 = 1/3. ;   affine[1].b1 = 0.0 ;
#  323|   

Error: CPPCHECK_WARNING (CWE-476): [#def24]
freeglut-3.8.0/progs/demos/Fractals_random/fractals_random.c:322: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: affine
#  320|   
#  321|       affine[1].a00 = 1/6. ;  affine[1].a01 = -1/3.*sin(FGH_PI/3.) ;   affine[1].a10 = 1/3.*sin(FGH_PI/3.) ;   affine[1].a11 = 1/6. ;
#  322|->     affine[1].b0 = 1/3. ;   affine[1].b1 = 0.0 ;
#  323|   
#  324|       affine[2].a00 = 1/6. ;  affine[2].a01 = -1/3.*sin(-FGH_PI/3.) ;  affine[2].a10 = 1/3.*sin(-FGH_PI/3.) ;  affine[2].a11 = 1/6. ;

Error: CPPCHECK_WARNING (CWE-476): [#def25]
freeglut-3.8.0/progs/demos/Fractals_random/fractals_random.c:324: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: affine
#  322|       affine[1].b0 = 1/3. ;   affine[1].b1 = 0.0 ;
#  323|   
#  324|->     affine[2].a00 = 1/6. ;  affine[2].a01 = -1/3.*sin(-FGH_PI/3.) ;  affine[2].a10 = 1/3.*sin(-FGH_PI/3.) ;  affine[2].a11 = 1/6. ;
#  325|       affine[2].b0 = 0.5 ;    affine[2].b1 = sqrt(3)/6. ;
#  326|   

Error: CPPCHECK_WARNING (CWE-476): [#def26]
freeglut-3.8.0/progs/demos/Fractals_random/fractals_random.c:325: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: affine
#  323|   
#  324|       affine[2].a00 = 1/6. ;  affine[2].a01 = -1/3.*sin(-FGH_PI/3.) ;  affine[2].a10 = 1/3.*sin(-FGH_PI/3.) ;  affine[2].a11 = 1/6. ;
#  325|->     affine[2].b0 = 0.5 ;    affine[2].b1 = sqrt(3)/6. ;
#  326|   
#  327|       affine[3].a00 = 1/3. ;  affine[3].a01 = 0.00 ;  affine[3].a10 = 0.00 ;  affine[3].a11 = 1/3. ;

Error: CPPCHECK_WARNING (CWE-476): [#def27]
freeglut-3.8.0/progs/demos/Fractals_random/fractals_random.c:327: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: affine
#  325|       affine[2].b0 = 0.5 ;    affine[2].b1 = sqrt(3)/6. ;
#  326|   
#  327|->     affine[3].a00 = 1/3. ;  affine[3].a01 = 0.00 ;  affine[3].a10 = 0.00 ;  affine[3].a11 = 1/3. ;
#  328|       affine[3].b0 = 2/3. ;   affine[3].b1 = 0.0 ;
#  329|     }

Error: CPPCHECK_WARNING (CWE-476): [#def28]
freeglut-3.8.0/progs/demos/Fractals_random/fractals_random.c:328: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: affine
#  326|   
#  327|       affine[3].a00 = 1/3. ;  affine[3].a01 = 0.00 ;  affine[3].a10 = 0.00 ;  affine[3].a11 = 1/3. ;
#  328|->     affine[3].b0 = 2/3. ;   affine[3].b1 = 0.0 ;
#  329|     }
#  330|   

Error: CPPCHECK_WARNING (CWE-476): [#def29]
freeglut-3.8.0/progs/demos/Fractals_random/fractals_random.c:338: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: affine
#  336|       /* Calculate the stationary point */
#  337|   
#  338|->     m00 = 1.0 - affine[i].a00 ;
#  339|       m01 =     - affine[i].a01 ;
#  340|       m10 =     - affine[i].a10 ;

Error: CPPCHECK_WARNING (CWE-476): [#def30]
freeglut-3.8.0/progs/demos/Fractals_random/fractals_random.c:339: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: affine
#  337|   
#  338|       m00 = 1.0 - affine[i].a00 ;
#  339|->     m01 =     - affine[i].a01 ;
#  340|       m10 =     - affine[i].a10 ;
#  341|       m11 = 1.0 - affine[i].a11 ;

Error: CPPCHECK_WARNING (CWE-476): [#def31]
freeglut-3.8.0/progs/demos/Fractals_random/fractals_random.c:340: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: affine
#  338|       m00 = 1.0 - affine[i].a00 ;
#  339|       m01 =     - affine[i].a01 ;
#  340|->     m10 =     - affine[i].a10 ;
#  341|       m11 = 1.0 - affine[i].a11 ;
#  342|   

Error: CPPCHECK_WARNING (CWE-476): [#def32]
freeglut-3.8.0/progs/demos/Fractals_random/fractals_random.c:341: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: affine
#  339|       m01 =     - affine[i].a01 ;
#  340|       m10 =     - affine[i].a10 ;
#  341|->     m11 = 1.0 - affine[i].a11 ;
#  342|   
#  343|       determ = m00 * m11 - m01 * m10 ;

Error: GCC_ANALYZER_WARNING: [#def33]
freeglut-3.8.0/progs/demos/Lorenz/lorenz.c:87:3: warning[-Wanalyzer-overlapping-buffers]: overlapping buffers passed as arguments to ‘memcpy’
freeglut-3.8.0/progs/demos/Lorenz/lorenz.c:306:6: enter_function: entry to ‘timer_cb’
freeglut-3.8.0/progs/demos/Lorenz/lorenz.c:315:6: branch_true: following ‘true’ branch...
freeglut-3.8.0/progs/demos/Lorenz/lorenz.c:317:8: branch_true: ...to here
freeglut-3.8.0/progs/demos/Lorenz/lorenz.c:318:5: call_function: calling ‘advance_in_time’ from ‘timer_cb’
#   85|     double deriv0[3], deriv1[3], deriv2[3], deriv3[3] ;
#   86|     int i ;
#   87|->   memcpy ( new_position, position, 3 * sizeof(double) ) ;  /* Save the present values */
#   88|   
#   89|     /* First pass in a Fourth-Order Runge-Kutta integration method */

Error: GCC_ANALYZER_WARNING (CWE-121): [#def34]
freeglut-3.8.0/progs/demos/keyboard/keyboard.c:48:25: warning[-Wanalyzer-out-of-bounds]: stack-based buffer overflow
freeglut-3.8.0/progs/demos/keyboard/keyboard.c:46:11: branch_true: following ‘true’ branch...
freeglut-3.8.0/progs/demos/keyboard/keyboard.c:47:20: branch_true: ...to here
freeglut-3.8.0/progs/demos/keyboard/keyboard.c:47:19: branch_true: following ‘true’ branch...
freeglut-3.8.0/progs/demos/keyboard/keyboard.c:48:25: branch_true: ...to here
freeglut-3.8.0/progs/demos/keyboard/keyboard.c:48:25: danger: out-of-bounds write from byte 256 till byte 259 but ‘str’ ends at byte 256
#   46|   	if(cur_key > 0) {
#   47|   		if(isprint(cur_key)) {
#   48|-> 			sprintf(str + 4, " '%c'", cur_key);
#   49|   		} else {
#   50|   			sprintf(str + 4, " 0x%02x", cur_key);

Error: GCC_ANALYZER_WARNING (CWE-121): [#def35]
freeglut-3.8.0/progs/demos/keyboard/keyboard.c:50:25: warning[-Wanalyzer-out-of-bounds]: stack-based buffer overflow
freeglut-3.8.0/progs/demos/keyboard/keyboard.c:46:11: branch_true: following ‘true’ branch...
freeglut-3.8.0/progs/demos/keyboard/keyboard.c:47:20: branch_true: ...to here
freeglut-3.8.0/progs/demos/keyboard/keyboard.c:47:19: branch_false: following ‘false’ branch...
freeglut-3.8.0/progs/demos/keyboard/keyboard.c:50:25: branch_false: ...to here
freeglut-3.8.0/progs/demos/keyboard/keyboard.c:50:25: danger: out-of-bounds write from byte 256 till byte 259 but ‘str’ ends at byte 256
#   48|   			sprintf(str + 4, " '%c'", cur_key);
#   49|   		} else {
#   50|-> 			sprintf(str + 4, " 0x%02x", cur_key);
#   51|   		}
#   52|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def36]
freeglut-3.8.0/progs/demos/shapes/shapes.c:322:9: warning[-Wanalyzer-malloc-leak]: leak of ‘infoLog’
freeglut-3.8.0/progs/demos/shapes/shapes.c:317:8: branch_true: following ‘true’ branch...
freeglut-3.8.0/progs/demos/shapes/shapes.c:320:9: branch_true: ...to here
freeglut-3.8.0/progs/demos/shapes/shapes.c:321:32: acquire_memory: allocated here
freeglut-3.8.0/progs/demos/shapes/shapes.c:322:9: throw: if the called function throws an exception...
freeglut-3.8.0/progs/demos/shapes/shapes.c:322:9: danger: ‘infoLog’ leaks here; was allocated at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#  320|           gl_GetShaderiv (shader, GL_INFO_LOG_LENGTH, &infoLogLength);
#  321|           infoLog = (ourGLchar*) malloc (infoLogLength);
#  322|->         gl_GetShaderInfoLog (shader, infoLogLength, NULL, infoLog);
#  323|           fprintf (stderr, "compile log: %s\n", infoLog);
#  324|           free (infoLog);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def37]
freeglut-3.8.0/progs/demos/shapes/shapes.c:350:9: warning[-Wanalyzer-malloc-leak]: leak of ‘infoLog’
freeglut-3.8.0/progs/demos/shapes/shapes.c:345:8: branch_true: following ‘true’ branch...
freeglut-3.8.0/progs/demos/shapes/shapes.c:348:9: branch_true: ...to here
freeglut-3.8.0/progs/demos/shapes/shapes.c:349:32: acquire_memory: allocated here
freeglut-3.8.0/progs/demos/shapes/shapes.c:350:9: throw: if the called function throws an exception...
freeglut-3.8.0/progs/demos/shapes/shapes.c:350:9: danger: ‘infoLog’ leaks here; was allocated at [(3)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/2)
#  348|           gl_GetProgramiv (program, GL_INFO_LOG_LENGTH, &infoLogLength);
#  349|           infoLog = (ourGLchar*) malloc (infoLogLength);
#  350|->         gl_GetProgramInfoLog (program, infoLogLength, NULL, infoLog);
#  351|           fprintf (stderr, "link log: %s\n", infoLog);
#  352|           free (infoLog);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def38]
freeglut-3.8.0/progs/demos/smooth_opengl3/smooth_opengl3.c:271:6: warning[-Wanalyzer-malloc-leak]: leak of ‘infoLog’
freeglut-3.8.0/progs/demos/smooth_opengl3/smooth_opengl3.c:270:29: acquire_memory: allocated here
freeglut-3.8.0/progs/demos/smooth_opengl3/smooth_opengl3.c:271:6: throw: if the called function throws an exception...
freeglut-3.8.0/progs/demos/smooth_opengl3/smooth_opengl3.c:271:6: danger: ‘infoLog’ leaks here; was allocated at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#  269|        gl_GetShaderiv (shader, GL_INFO_LOG_LENGTH, &infoLogLength);
#  270|        infoLog = (ourGLchar*) malloc (infoLogLength);
#  271|->      gl_GetShaderInfoLog (shader, infoLogLength, NULL, infoLog);
#  272|        fprintf (stderr, "compile log: %s\n", infoLog);
#  273|        free (infoLog);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def39]
freeglut-3.8.0/progs/demos/smooth_opengl3/smooth_opengl3.c:295:6: warning[-Wanalyzer-malloc-leak]: leak of ‘infoLog’
freeglut-3.8.0/progs/demos/smooth_opengl3/smooth_opengl3.c:294:29: acquire_memory: allocated here
freeglut-3.8.0/progs/demos/smooth_opengl3/smooth_opengl3.c:295:6: throw: if the called function throws an exception...
freeglut-3.8.0/progs/demos/smooth_opengl3/smooth_opengl3.c:295:6: danger: ‘infoLog’ leaks here; was allocated at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
#  293|        gl_GetProgramiv (program, GL_INFO_LOG_LENGTH, &infoLogLength);
#  294|        infoLog = (ourGLchar*) malloc (infoLogLength);
#  295|->      gl_GetProgramInfoLog (program, infoLogLength, NULL, infoLog);
#  296|        fprintf (stderr, "link log: %s\n", infoLog);
#  297|        free (infoLog);

Error: CPPCHECK_WARNING (CWE-476): [#def40]
freeglut-3.8.0/progs/demos/subwin/subwin.c:223: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: strings
#  221|   	strings = malloc(sizeof(char *)*(winmax+1));
#  222|   	for (i=0;i<winmax+1;i++) {
#  223|-> 		strings[i] = malloc(sizeof(char)*MAXSTR+1);
#  224|   		strings[i][0]=0;
#  225|   	}

Error: GCC_ANALYZER_WARNING (CWE-476): [#def41]
freeglut-3.8.0/progs/demos/subwin/subwin.c:223:17: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘strings’
freeglut-3.8.0/progs/demos/subwin/subwin.c:221:19: acquire_memory: this call could return NULL
freeglut-3.8.0/progs/demos/subwin/subwin.c:222:18: branch_true: following ‘true’ branch (when ‘i <= winmax’)...
freeglut-3.8.0/progs/demos/subwin/subwin.c:223:24: branch_true: ...to here
freeglut-3.8.0/progs/demos/subwin/subwin.c:223:17: danger: ‘strings + (long unsigned int)i * 8’ could be NULL: unchecked value from [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#  221|   	strings = malloc(sizeof(char *)*(winmax+1));
#  222|   	for (i=0;i<winmax+1;i++) {
#  223|-> 		strings[i] = malloc(sizeof(char)*MAXSTR+1);
#  224|   		strings[i][0]=0;
#  225|   	}

Error: CPPCHECK_WARNING (CWE-476): [#def42]
freeglut-3.8.0/progs/demos/subwin/subwin.c:224: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: strings
#  222|   	for (i=0;i<winmax+1;i++) {
#  223|   		strings[i] = malloc(sizeof(char)*MAXSTR+1);
#  224|-> 		strings[i][0]=0;
#  225|   	}
#  226|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def43]
freeglut-3.8.0/progs/demos/subwin/subwin.c:224:17: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘malloc(17)’
freeglut-3.8.0/progs/demos/subwin/subwin.c:222:18: branch_true: following ‘true’ branch (when ‘i <= winmax’)...
freeglut-3.8.0/progs/demos/subwin/subwin.c:223:24: branch_true: ...to here
freeglut-3.8.0/progs/demos/subwin/subwin.c:223:30: acquire_memory: this call could return NULL
freeglut-3.8.0/progs/demos/subwin/subwin.c:224:17: danger: ‘malloc(17)’ could be NULL: unchecked value from [(3)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/2)
#  222|   	for (i=0;i<winmax+1;i++) {
#  223|   		strings[i] = malloc(sizeof(char)*MAXSTR+1);
#  224|-> 		strings[i][0]=0;
#  225|   	}
#  226|   

Error: GCC_ANALYZER_WARNING (CWE-121): [#def44]
freeglut-3.8.0/progs/demos/timer/timer.c:47:9: warning[-Wanalyzer-out-of-bounds]: stack-based buffer overflow
freeglut-3.8.0/progs/demos/timer/timer.c:38:17: branch_true: following ‘true’ branch (when ‘i != 3’)...
freeglut-3.8.0/progs/demos/timer/timer.c:40:14: branch_true: ...to here
freeglut-3.8.0/progs/demos/timer/timer.c:42:13: branch_true: following ‘true’ branch...
freeglut-3.8.0/progs/demos/timer/timer.c:47:9: danger: out-of-bounds write at byte 10 but ‘temp’ ends at byte 10
#   45|               temp[0] = '-';
#   46|   
#   47|->         sprintf(temp + 1, " %4d ms", timerInts[i]);
#   48|   
#   49|           glutAddMenuEntry(temp, timerInts[i]);

Error: GCC_ANALYZER_WARNING (CWE-121): [#def45]
freeglut-3.8.0/progs/demos/timer/timer.c:65:9: warning[-Wanalyzer-out-of-bounds]: stack-based buffer overflow
freeglut-3.8.0/progs/demos/timer/timer.c:56:17: branch_true: following ‘true’ branch (when ‘i != 3’)...
freeglut-3.8.0/progs/demos/timer/timer.c:58:14: branch_true: ...to here
freeglut-3.8.0/progs/demos/timer/timer.c:60:13: branch_true: following ‘true’ branch...
freeglut-3.8.0/progs/demos/timer/timer.c:65:9: danger: out-of-bounds write at byte 10 but ‘temp’ ends at byte 10
#   63|               temp[0] = '-';
#   64|   
#   65|->         sprintf(temp + 1, " %4d ms", timerInts[i]);
#   66|   
#   67|           glutChangeToMenuEntry(i+1, temp, timerInts[i]);

Error: GCC_ANALYZER_WARNING (CWE-121): [#def46]
freeglut-3.8.0/progs/demos/timer_callback/timer.c:63:9: warning[-Wanalyzer-out-of-bounds]: stack-based buffer overflow
freeglut-3.8.0/progs/demos/timer_callback/timer.c:54:17: branch_true: following ‘true’ branch (when ‘i != 3’)...
freeglut-3.8.0/progs/demos/timer_callback/timer.c:56:14: branch_true: ...to here
freeglut-3.8.0/progs/demos/timer_callback/timer.c:58:12: branch_true: following ‘true’ branch...
freeglut-3.8.0/progs/demos/timer_callback/timer.c:58:12: branch_true: ...to here
freeglut-3.8.0/progs/demos/timer_callback/timer.c:63:9: danger: out-of-bounds write at byte 10 but ‘temp’ ends at byte 10
#   61|               temp[0] = '-';
#   62|   
#   63|->         sprintf(temp + 1, " %4d ms", timerInts[i]);
#   64|   
#   65|           glutAddMenuEntry(temp, timerInts[i]);

Error: GCC_ANALYZER_WARNING (CWE-121): [#def47]
freeglut-3.8.0/progs/demos/timer_callback/timer.c:81:9: warning[-Wanalyzer-out-of-bounds]: stack-based buffer overflow
freeglut-3.8.0/progs/demos/timer_callback/timer.c:72:17: branch_true: following ‘true’ branch (when ‘i != 3’)...
freeglut-3.8.0/progs/demos/timer_callback/timer.c:74:14: branch_true: ...to here
freeglut-3.8.0/progs/demos/timer_callback/timer.c:76:12: branch_true: following ‘true’ branch...
freeglut-3.8.0/progs/demos/timer_callback/timer.c:76:12: branch_true: ...to here
freeglut-3.8.0/progs/demos/timer_callback/timer.c:81:9: danger: out-of-bounds write at byte 10 but ‘temp’ ends at byte 10
#   79|               temp[0] = '-';
#   80|   
#   81|->         sprintf(temp + 1, " %4d ms", timerInts[i]);
#   82|   
#   83|           glutChangeToMenuEntry(i+1, temp, timerInts[i]);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def48]
freeglut-3.8.0/src/fg_callbacks.c:55:5: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘timer’
freeglut-3.8.0/src/fg_callbacks.c:44:7: branch_false: following ‘false’ branch (when ‘timer’ is NULL)...
freeglut-3.8.0/src/fg_callbacks.c:50:24: branch_false: ...to here
freeglut-3.8.0/src/fg_callbacks.c:50:11: branch_true: following ‘true’ branch (when ‘timer’ is NULL)...
freeglut-3.8.0/src/fg_callbacks.c:51:13: branch_true: ...to here
freeglut-3.8.0/src/fg_callbacks.c:55:5: danger: dereference of NULL ‘timer’
#   53|       }
#   54|   
#   55|->     timer->Callback     = callback;
#   56|       timer->CallbackData = userData;
#   57|       timer->ID           = timerID;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def49]
freeglut-3.8.0/src/fg_callbacks.c:58:27: warning[-Wanalyzer-malloc-leak]: leak of ‘timer’
freeglut-3.8.0/src/fg_callbacks.c:44:7: branch_false: following ‘false’ branch (when ‘timer’ is NULL)...
freeglut-3.8.0/src/fg_callbacks.c:50:24: branch_false: ...to here
freeglut-3.8.0/src/fg_callbacks.c:50:24: acquire_memory: allocated here
freeglut-3.8.0/src/fg_callbacks.c:50:11: branch_false: following ‘false’ branch (when ‘timer’ is non-NULL)...
freeglut-3.8.0/src/fg_callbacks.c:55:5: branch_false: ...to here
freeglut-3.8.0/src/fg_callbacks.c:58:27: throw: if ‘fgElapsedTime’ throws an exception...
freeglut-3.8.0/src/fg_callbacks.c:58:27: danger: ‘timer’ leaks here; was allocated at [(3)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/2)
#   56|       timer->CallbackData = userData;
#   57|       timer->ID           = timerID;
#   58|->     timer->TriggerTime  = fgElapsedTime() + timeOut;
#   59|   
#   60|       /* Insert such that timers are sorted by end-time */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def50]
freeglut-3.8.0/src/fg_callbacks.c:67:5: warning[-Wanalyzer-malloc-leak]: leak of ‘timer’
freeglut-3.8.0/src/fg_callbacks.c:44:7: branch_false: following ‘false’ branch (when ‘timer’ is NULL)...
freeglut-3.8.0/src/fg_callbacks.c:50:24: branch_false: ...to here
freeglut-3.8.0/src/fg_callbacks.c:50:24: acquire_memory: allocated here
freeglut-3.8.0/src/fg_callbacks.c:50:11: branch_false: following ‘false’ branch (when ‘timer’ is non-NULL)...
freeglut-3.8.0/src/fg_callbacks.c:55:5: branch_false: ...to here
freeglut-3.8.0/src/fg_callbacks.c:67:5: branch_false: following ‘false’ branch (when ‘node’ is NULL)...
freeglut-3.8.0/src/fg_callbacks.c:67:5: branch_false: ...to here
freeglut-3.8.0/src/fg_callbacks.c:67:5: throw: if ‘fgListInsert’ throws an exception...
freeglut-3.8.0/src/fg_callbacks.c:67:5: danger: ‘timer’ leaks here; was allocated at [(3)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/2)
#   65|       }
#   66|   
#   67|->     fgListInsert( &fgState.Timers, node ? &node->Node : 0, &timer->Node );
#   68|   }
#   69|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def51]
freeglut-3.8.0/src/fg_geometry.c:412:9: warning[-Wanalyzer-malloc-leak]: leak of ‘normals’
freeglut-3.8.0/src/fg_geometry.c:2289:17: enter_function: entry to ‘glutWireSierpinskiSponge’
freeglut-3.8.0/src/fg_geometry.c:2292:5: call_function: calling ‘fghSierpinskiSponge’ from ‘glutWireSierpinskiSponge’
#  410|   
#  411|       if (numVertices > 0 && attribute_v_coord != -1) {
#  412|->         fghGenBuffers(1, &vbo_coords);
#  413|           fghBindBuffer(FGH_ARRAY_BUFFER, vbo_coords);
#  414|           fghBufferData(FGH_ARRAY_BUFFER, numVertices * 3 * sizeof(vertices[0]),

Error: GCC_ANALYZER_WARNING (CWE-401): [#def52]
freeglut-3.8.0/src/fg_geometry.c:412:9: warning[-Wanalyzer-malloc-leak]: leak of ‘vertices’
freeglut-3.8.0/src/fg_geometry.c:2289:17: enter_function: entry to ‘glutWireSierpinskiSponge’
freeglut-3.8.0/src/fg_geometry.c:2292:5: call_function: calling ‘fghSierpinskiSponge’ from ‘glutWireSierpinskiSponge’
#  410|   
#  411|       if (numVertices > 0 && attribute_v_coord != -1) {
#  412|->         fghGenBuffers(1, &vbo_coords);
#  413|           fghBindBuffer(FGH_ARRAY_BUFFER, vbo_coords);
#  414|           fghBufferData(FGH_ARRAY_BUFFER, numVertices * 3 * sizeof(vertices[0]),

Error: GCC_ANALYZER_WARNING (CWE-401): [#def53]
freeglut-3.8.0/src/fg_geometry.c:413:9: warning[-Wanalyzer-malloc-leak]: leak of ‘normals’
freeglut-3.8.0/src/fg_geometry.c:2289:17: enter_function: entry to ‘glutWireSierpinskiSponge’
freeglut-3.8.0/src/fg_geometry.c:2292:5: call_function: calling ‘fghSierpinskiSponge’ from ‘glutWireSierpinskiSponge’
#  411|       if (numVertices > 0 && attribute_v_coord != -1) {
#  412|           fghGenBuffers(1, &vbo_coords);
#  413|->         fghBindBuffer(FGH_ARRAY_BUFFER, vbo_coords);
#  414|           fghBufferData(FGH_ARRAY_BUFFER, numVertices * 3 * sizeof(vertices[0]),
#  415|                         vertices, FGH_STATIC_DRAW);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def54]
freeglut-3.8.0/src/fg_geometry.c:413:9: warning[-Wanalyzer-malloc-leak]: leak of ‘vertices’
freeglut-3.8.0/src/fg_geometry.c:2289:17: enter_function: entry to ‘glutWireSierpinskiSponge’
freeglut-3.8.0/src/fg_geometry.c:2292:5: call_function: calling ‘fghSierpinskiSponge’ from ‘glutWireSierpinskiSponge’
#  411|       if (numVertices > 0 && attribute_v_coord != -1) {
#  412|           fghGenBuffers(1, &vbo_coords);
#  413|->         fghBindBuffer(FGH_ARRAY_BUFFER, vbo_coords);
#  414|           fghBufferData(FGH_ARRAY_BUFFER, numVertices * 3 * sizeof(vertices[0]),
#  415|                         vertices, FGH_STATIC_DRAW);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def55]
freeglut-3.8.0/src/fg_geometry.c:414:9: warning[-Wanalyzer-malloc-leak]: leak of ‘normals’
freeglut-3.8.0/src/fg_geometry.c:2289:17: enter_function: entry to ‘glutWireSierpinskiSponge’
freeglut-3.8.0/src/fg_geometry.c:2292:5: call_function: calling ‘fghSierpinskiSponge’ from ‘glutWireSierpinskiSponge’
#  412|           fghGenBuffers(1, &vbo_coords);
#  413|           fghBindBuffer(FGH_ARRAY_BUFFER, vbo_coords);
#  414|->         fghBufferData(FGH_ARRAY_BUFFER, numVertices * 3 * sizeof(vertices[0]),
#  415|                         vertices, FGH_STATIC_DRAW);
#  416|       }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def56]
freeglut-3.8.0/src/fg_geometry.c:414:9: warning[-Wanalyzer-malloc-leak]: leak of ‘vertices’
freeglut-3.8.0/src/fg_geometry.c:2289:17: enter_function: entry to ‘glutWireSierpinskiSponge’
freeglut-3.8.0/src/fg_geometry.c:2292:5: call_function: calling ‘fghSierpinskiSponge’ from ‘glutWireSierpinskiSponge’
#  412|           fghGenBuffers(1, &vbo_coords);
#  413|           fghBindBuffer(FGH_ARRAY_BUFFER, vbo_coords);
#  414|->         fghBufferData(FGH_ARRAY_BUFFER, numVertices * 3 * sizeof(vertices[0]),
#  415|                         vertices, FGH_STATIC_DRAW);
#  416|       }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def57]
freeglut-3.8.0/src/fg_geometry.c:419:9: warning[-Wanalyzer-malloc-leak]: leak of ‘normals’
freeglut-3.8.0/src/fg_geometry.c:2289:17: enter_function: entry to ‘glutWireSierpinskiSponge’
freeglut-3.8.0/src/fg_geometry.c:2292:5: call_function: calling ‘fghSierpinskiSponge’ from ‘glutWireSierpinskiSponge’
#  417|   
#  418|       if (numVertices > 0 && attribute_v_normal != -1) {
#  419|->         fghGenBuffers(1, &vbo_normals);
#  420|           fghBindBuffer(FGH_ARRAY_BUFFER, vbo_normals);
#  421|           fghBufferData(FGH_ARRAY_BUFFER, numVertices * 3 * sizeof(normals[0]),

Error: GCC_ANALYZER_WARNING (CWE-401): [#def58]
freeglut-3.8.0/src/fg_geometry.c:419:9: warning[-Wanalyzer-malloc-leak]: leak of ‘vertices’
freeglut-3.8.0/src/fg_geometry.c:2289:17: enter_function: entry to ‘glutWireSierpinskiSponge’
freeglut-3.8.0/src/fg_geometry.c:2292:5: call_function: calling ‘fghSierpinskiSponge’ from ‘glutWireSierpinskiSponge’
#  417|   
#  418|       if (numVertices > 0 && attribute_v_normal != -1) {
#  419|->         fghGenBuffers(1, &vbo_normals);
#  420|           fghBindBuffer(FGH_ARRAY_BUFFER, vbo_normals);
#  421|           fghBufferData(FGH_ARRAY_BUFFER, numVertices * 3 * sizeof(normals[0]),

Error: GCC_ANALYZER_WARNING (CWE-401): [#def59]
freeglut-3.8.0/src/fg_geometry.c:420:9: warning[-Wanalyzer-malloc-leak]: leak of ‘normals’
freeglut-3.8.0/src/fg_geometry.c:2289:17: enter_function: entry to ‘glutWireSierpinskiSponge’
freeglut-3.8.0/src/fg_geometry.c:2292:5: call_function: calling ‘fghSierpinskiSponge’ from ‘glutWireSierpinskiSponge’
#  418|       if (numVertices > 0 && attribute_v_normal != -1) {
#  419|           fghGenBuffers(1, &vbo_normals);
#  420|->         fghBindBuffer(FGH_ARRAY_BUFFER, vbo_normals);
#  421|           fghBufferData(FGH_ARRAY_BUFFER, numVertices * 3 * sizeof(normals[0]),
#  422|                         normals, FGH_STATIC_DRAW);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def60]
freeglut-3.8.0/src/fg_geometry.c:420:9: warning[-Wanalyzer-malloc-leak]: leak of ‘vertices’
freeglut-3.8.0/src/fg_geometry.c:2289:17: enter_function: entry to ‘glutWireSierpinskiSponge’
freeglut-3.8.0/src/fg_geometry.c:2292:5: call_function: calling ‘fghSierpinskiSponge’ from ‘glutWireSierpinskiSponge’
#  418|       if (numVertices > 0 && attribute_v_normal != -1) {
#  419|           fghGenBuffers(1, &vbo_normals);
#  420|->         fghBindBuffer(FGH_ARRAY_BUFFER, vbo_normals);
#  421|           fghBufferData(FGH_ARRAY_BUFFER, numVertices * 3 * sizeof(normals[0]),
#  422|                         normals, FGH_STATIC_DRAW);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def61]
freeglut-3.8.0/src/fg_geometry.c:421:9: warning[-Wanalyzer-malloc-leak]: leak of ‘normals’
freeglut-3.8.0/src/fg_geometry.c:2289:17: enter_function: entry to ‘glutWireSierpinskiSponge’
freeglut-3.8.0/src/fg_geometry.c:2292:5: call_function: calling ‘fghSierpinskiSponge’ from ‘glutWireSierpinskiSponge’
#  419|           fghGenBuffers(1, &vbo_normals);
#  420|           fghBindBuffer(FGH_ARRAY_BUFFER, vbo_normals);
#  421|->         fghBufferData(FGH_ARRAY_BUFFER, numVertices * 3 * sizeof(normals[0]),
#  422|                         normals, FGH_STATIC_DRAW);
#  423|       }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def62]
freeglut-3.8.0/src/fg_geometry.c:523:9: warning[-Wanalyzer-malloc-leak]: leak of ‘normals’
freeglut-3.8.0/src/fg_geometry.c:2294:17: enter_function: entry to ‘glutSolidSierpinskiSponge’
freeglut-3.8.0/src/fg_geometry.c:2297:5: call_function: calling ‘fghSierpinskiSponge’ from ‘glutSolidSierpinskiSponge’
#  521|   
#  522|       if (numVertices > 0 && attribute_v_coord != -1) {
#  523|->         fghGenBuffers(1, &vbo_coords);
#  524|           fghBindBuffer(FGH_ARRAY_BUFFER, vbo_coords);
#  525|           fghBufferData(FGH_ARRAY_BUFFER, numVertices * 3 * sizeof(vertices[0]),

Error: GCC_ANALYZER_WARNING (CWE-401): [#def63]
freeglut-3.8.0/src/fg_geometry.c:523:9: warning[-Wanalyzer-malloc-leak]: leak of ‘vertices’
freeglut-3.8.0/src/fg_geometry.c:2294:17: enter_function: entry to ‘glutSolidSierpinskiSponge’
freeglut-3.8.0/src/fg_geometry.c:2297:5: call_function: calling ‘fghSierpinskiSponge’ from ‘glutSolidSierpinskiSponge’
#  521|   
#  522|       if (numVertices > 0 && attribute_v_coord != -1) {
#  523|->         fghGenBuffers(1, &vbo_coords);
#  524|           fghBindBuffer(FGH_ARRAY_BUFFER, vbo_coords);
#  525|           fghBufferData(FGH_ARRAY_BUFFER, numVertices * 3 * sizeof(vertices[0]),

Error: GCC_ANALYZER_WARNING (CWE-401): [#def64]
freeglut-3.8.0/src/fg_geometry.c:524:9: warning[-Wanalyzer-malloc-leak]: leak of ‘normals’
freeglut-3.8.0/src/fg_geometry.c:2294:17: enter_function: entry to ‘glutSolidSierpinskiSponge’
freeglut-3.8.0/src/fg_geometry.c:2297:5: call_function: calling ‘fghSierpinskiSponge’ from ‘glutSolidSierpinskiSponge’
#  522|       if (numVertices > 0 && attribute_v_coord != -1) {
#  523|           fghGenBuffers(1, &vbo_coords);
#  524|->         fghBindBuffer(FGH_ARRAY_BUFFER, vbo_coords);
#  525|           fghBufferData(FGH_ARRAY_BUFFER, numVertices * 3 * sizeof(vertices[0]),
#  526|                         vertices, FGH_STATIC_DRAW);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def65]
freeglut-3.8.0/src/fg_geometry.c:524:9: warning[-Wanalyzer-malloc-leak]: leak of ‘vertices’
freeglut-3.8.0/src/fg_geometry.c:2294:17: enter_function: entry to ‘glutSolidSierpinskiSponge’
freeglut-3.8.0/src/fg_geometry.c:2297:5: call_function: calling ‘fghSierpinskiSponge’ from ‘glutSolidSierpinskiSponge’
#  522|       if (numVertices > 0 && attribute_v_coord != -1) {
#  523|           fghGenBuffers(1, &vbo_coords);
#  524|->         fghBindBuffer(FGH_ARRAY_BUFFER, vbo_coords);
#  525|           fghBufferData(FGH_ARRAY_BUFFER, numVertices * 3 * sizeof(vertices[0]),
#  526|                         vertices, FGH_STATIC_DRAW);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def66]
freeglut-3.8.0/src/fg_geometry.c:525:9: warning[-Wanalyzer-malloc-leak]: leak of ‘normals’
freeglut-3.8.0/src/fg_geometry.c:2294:17: enter_function: entry to ‘glutSolidSierpinskiSponge’
freeglut-3.8.0/src/fg_geometry.c:2297:5: call_function: calling ‘fghSierpinskiSponge’ from ‘glutSolidSierpinskiSponge’
#  523|           fghGenBuffers(1, &vbo_coords);
#  524|           fghBindBuffer(FGH_ARRAY_BUFFER, vbo_coords);
#  525|->         fghBufferData(FGH_ARRAY_BUFFER, numVertices * 3 * sizeof(vertices[0]),
#  526|                         vertices, FGH_STATIC_DRAW);
#  527|           fghBindBuffer(FGH_ARRAY_BUFFER, 0);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def67]
freeglut-3.8.0/src/fg_geometry.c:525:9: warning[-Wanalyzer-malloc-leak]: leak of ‘vertices’
freeglut-3.8.0/src/fg_geometry.c:2294:17: enter_function: entry to ‘glutSolidSierpinskiSponge’
freeglut-3.8.0/src/fg_geometry.c:2297:5: call_function: calling ‘fghSierpinskiSponge’ from ‘glutSolidSierpinskiSponge’
#  523|           fghGenBuffers(1, &vbo_coords);
#  524|           fghBindBuffer(FGH_ARRAY_BUFFER, vbo_coords);
#  525|->         fghBufferData(FGH_ARRAY_BUFFER, numVertices * 3 * sizeof(vertices[0]),
#  526|                         vertices, FGH_STATIC_DRAW);
#  527|           fghBindBuffer(FGH_ARRAY_BUFFER, 0);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def68]
freeglut-3.8.0/src/fg_geometry.c:527:9: warning[-Wanalyzer-malloc-leak]: leak of ‘normals’
freeglut-3.8.0/src/fg_geometry.c:2294:17: enter_function: entry to ‘glutSolidSierpinskiSponge’
freeglut-3.8.0/src/fg_geometry.c:2297:5: call_function: calling ‘fghSierpinskiSponge’ from ‘glutSolidSierpinskiSponge’
#  525|           fghBufferData(FGH_ARRAY_BUFFER, numVertices * 3 * sizeof(vertices[0]),
#  526|                         vertices, FGH_STATIC_DRAW);
#  527|->         fghBindBuffer(FGH_ARRAY_BUFFER, 0);
#  528|       }
#  529|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def69]
freeglut-3.8.0/src/fg_geometry.c:531:9: warning[-Wanalyzer-malloc-leak]: leak of ‘normals’
freeglut-3.8.0/src/fg_geometry.c:2294:17: enter_function: entry to ‘glutSolidSierpinskiSponge’
freeglut-3.8.0/src/fg_geometry.c:2297:5: call_function: calling ‘fghSierpinskiSponge’ from ‘glutSolidSierpinskiSponge’
#  529|   
#  530|       if (numVertices > 0 && attribute_v_normal != -1) {
#  531|->         fghGenBuffers(1, &vbo_normals);
#  532|           fghBindBuffer(FGH_ARRAY_BUFFER, vbo_normals);
#  533|           fghBufferData(FGH_ARRAY_BUFFER, numVertices * 3 * sizeof(normals[0]),

Error: GCC_ANALYZER_WARNING (CWE-401): [#def70]
freeglut-3.8.0/src/fg_geometry.c:531:9: warning[-Wanalyzer-malloc-leak]: leak of ‘vertices’
freeglut-3.8.0/src/fg_geometry.c:2294:17: enter_function: entry to ‘glutSolidSierpinskiSponge’
freeglut-3.8.0/src/fg_geometry.c:2297:5: call_function: calling ‘fghSierpinskiSponge’ from ‘glutSolidSierpinskiSponge’
#  529|   
#  530|       if (numVertices > 0 && attribute_v_normal != -1) {
#  531|->         fghGenBuffers(1, &vbo_normals);
#  532|           fghBindBuffer(FGH_ARRAY_BUFFER, vbo_normals);
#  533|           fghBufferData(FGH_ARRAY_BUFFER, numVertices * 3 * sizeof(normals[0]),

Error: GCC_ANALYZER_WARNING (CWE-401): [#def71]
freeglut-3.8.0/src/fg_geometry.c:532:9: warning[-Wanalyzer-malloc-leak]: leak of ‘normals’
freeglut-3.8.0/src/fg_geometry.c:2294:17: enter_function: entry to ‘glutSolidSierpinskiSponge’
freeglut-3.8.0/src/fg_geometry.c:2297:5: call_function: calling ‘fghSierpinskiSponge’ from ‘glutSolidSierpinskiSponge’
#  530|       if (numVertices > 0 && attribute_v_normal != -1) {
#  531|           fghGenBuffers(1, &vbo_normals);
#  532|->         fghBindBuffer(FGH_ARRAY_BUFFER, vbo_normals);
#  533|           fghBufferData(FGH_ARRAY_BUFFER, numVertices * 3 * sizeof(normals[0]),
#  534|                         normals, FGH_STATIC_DRAW);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def72]
freeglut-3.8.0/src/fg_geometry.c:532:9: warning[-Wanalyzer-malloc-leak]: leak of ‘vertices’
freeglut-3.8.0/src/fg_geometry.c:2294:17: enter_function: entry to ‘glutSolidSierpinskiSponge’
freeglut-3.8.0/src/fg_geometry.c:2297:5: call_function: calling ‘fghSierpinskiSponge’ from ‘glutSolidSierpinskiSponge’
#  530|       if (numVertices > 0 && attribute_v_normal != -1) {
#  531|           fghGenBuffers(1, &vbo_normals);
#  532|->         fghBindBuffer(FGH_ARRAY_BUFFER, vbo_normals);
#  533|           fghBufferData(FGH_ARRAY_BUFFER, numVertices * 3 * sizeof(normals[0]),
#  534|                         normals, FGH_STATIC_DRAW);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def73]
freeglut-3.8.0/src/fg_geometry.c:648:9: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘verticesForNormalVisualization’
freeglut-3.8.0/src/fg_geometry.c:2300:1: enter_function: entry to ‘glutSolidTetrahedron’
freeglut-3.8.0/src/fg_geometry.c:2300:1: call_function: calling ‘fghTetrahedron’ from ‘glutSolidTetrahedron’
#  646|       for (i=0,j=0; i<numNormalVertices*3/2; i+=3, j+=6)
#  647|       {
#  648|->         verticesForNormalVisualization[j+0] = vertices[i+0];
#  649|           verticesForNormalVisualization[j+1] = vertices[i+1];
#  650|           verticesForNormalVisualization[j+2] = vertices[i+2];

Error: GCC_ANALYZER_WARNING (CWE-416): [#def74]
freeglut-3.8.0/src/fg_geometry.c:648:47: warning[-Wanalyzer-use-after-free]: use after ‘free’ of ‘vertices’
freeglut-3.8.0/src/fg_geometry.c:2294:17: enter_function: entry to ‘glutSolidSierpinskiSponge’
freeglut-3.8.0/src/fg_geometry.c:2297:5: call_function: calling ‘fghSierpinskiSponge’ from ‘glutSolidSierpinskiSponge’
#  646|       for (i=0,j=0; i<numNormalVertices*3/2; i+=3, j+=6)
#  647|       {
#  648|->         verticesForNormalVisualization[j+0] = vertices[i+0];
#  649|           verticesForNormalVisualization[j+1] = vertices[i+1];
#  650|           verticesForNormalVisualization[j+2] = vertices[i+2];

Error: GCC_ANALYZER_WARNING (CWE-457): [#def75]
freeglut-3.8.0/src/fg_geometry.c:648:47: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘*<unknown>’
freeglut-3.8.0/src/fg_geometry.c:2294:17: enter_function: entry to ‘glutSolidSierpinskiSponge’
freeglut-3.8.0/src/fg_geometry.c:2297:5: call_function: calling ‘fghSierpinskiSponge’ from ‘glutSolidSierpinskiSponge’
#  646|       for (i=0,j=0; i<numNormalVertices*3/2; i+=3, j+=6)
#  647|       {
#  648|->         verticesForNormalVisualization[j+0] = vertices[i+0];
#  649|           verticesForNormalVisualization[j+1] = vertices[i+1];
#  650|           verticesForNormalVisualization[j+2] = vertices[i+2];

Error: COMPILER_WARNING (CWE-457): [#def76]
freeglut-3.8.0/src/fg_geometry.c: scope_hint: In function ‘fghGenerateGeometryWithIndexArray’
freeglut-3.8.0/src/fg_geometry.c:759:13: warning[-Wmaybe-uninitialized]: ‘numEdgeIdxPerFace’ may be used uninitialized
#  759 |     int i,j,numEdgeIdxPerFace;
#      |             ^~~~~~~~~~~~~~~~~
#  757|   static void fghGenerateGeometryWithIndexArray(int numFaces, int numEdgePerFace, GLfloat *vertices, GLubyte *vertIndices, GLfloat *normals, GLfloat *vertOut, GLfloat *normOut, GLushort *vertIdxOut)
#  758|   {
#  759|->     int i,j,numEdgeIdxPerFace;
#  760|       GLubyte   *vertSamps = NULL;
#  761|       switch (numEdgePerFace)

Error: GCC_ANALYZER_WARNING (CWE-416): [#def77]
freeglut-3.8.0/src/fg_geometry.c:1219:17: warning[-Wanalyzer-use-after-free]: use after ‘free’ of ‘vertices’
freeglut-3.8.0/src/fg_geometry.c:2294:17: enter_function: entry to ‘glutSolidSierpinskiSponge’
freeglut-3.8.0/src/fg_geometry.c:2297:5: call_function: calling ‘fghSierpinskiSponge’ from ‘glutSolidSierpinskiSponge’
# 1217|                   int vertIdx = tetrahedron_vi[faceIdxVertIdx+j]*3;
# 1218|   
# 1219|->                 vertices[outIdx  ] = (GLfloat)offset[0] + scale * tetrahedron_v[vertIdx  ];
# 1220|                   vertices[outIdx+1] = (GLfloat)offset[1] + scale * tetrahedron_v[vertIdx+1];
# 1221|                   vertices[outIdx+2] = (GLfloat)offset[2] + scale * tetrahedron_v[vertIdx+2];

Error: GCC_ANALYZER_WARNING (CWE-416): [#def78]
freeglut-3.8.0/src/fg_geometry.c:1223:17: warning[-Wanalyzer-use-after-free]: use after ‘free’ of ‘normals’
freeglut-3.8.0/src/fg_geometry.c:2294:17: enter_function: entry to ‘glutSolidSierpinskiSponge’
freeglut-3.8.0/src/fg_geometry.c:2297:5: call_function: calling ‘fghSierpinskiSponge’ from ‘glutSolidSierpinskiSponge’
# 1221|                   vertices[outIdx+2] = (GLfloat)offset[2] + scale * tetrahedron_v[vertIdx+2];
# 1222|   
# 1223|->                 normals [outIdx  ] = tetrahedron_n[normIdx  ];
# 1224|                   normals [outIdx+1] = tetrahedron_n[normIdx+1];
# 1225|                   normals [outIdx+2] = tetrahedron_n[normIdx+2];

Error: GCC_ANALYZER_WARNING (CWE-688): [#def79]
freeglut-3.8.0/src/fg_init.c:511:5: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘buffer’ where non-null expected
freeglut-3.8.0/src/fg_init.c:510:28: acquire_memory: this call could return NULL
freeglut-3.8.0/src/fg_init.c:511:5: danger: argument 1 (‘buffer’) from [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0) could be NULL where non-null expected
#  509|       size_t len = strlen ( displayMode );
#  510|       char *buffer = (char *)malloc ( (len+1) * sizeof(char) );
#  511|->     memcpy ( buffer, displayMode, len );
#  512|       buffer[len] = '\0';
#  513|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def80]
freeglut-3.8.0/src/fg_init.c:628:21: warning[-Wanalyzer-malloc-leak]: leak of ‘buffer’
freeglut-3.8.0/src/fg_init.c:510:28: acquire_memory: allocated here
freeglut-3.8.0/src/fg_init.c:516:13: branch_true: following ‘true’ branch (when ‘token’ is non-NULL)...
freeglut-3.8.0/src/fg_init.c:525:30: branch_true: ...to here
freeglut-3.8.0/src/fg_init.c:527:22: branch_true: following ‘true’ branch (when ‘i != 38’)...
freeglut-3.8.0/src/fg_init.c:529:35: branch_true: ...to here
freeglut-3.8.0/src/fg_init.c:529:16: branch_false: following ‘false’ branch...
freeglut-3.8.0/src/fg_init.c:527:38: branch_false: ...to here
freeglut-3.8.0/src/fg_init.c:527:22: branch_true: following ‘true’ branch (when ‘i != 38’)...
freeglut-3.8.0/src/fg_init.c:529:35: branch_true: ...to here
freeglut-3.8.0/src/fg_init.c:527:22: branch_true: following ‘true’ branch (when ‘i != 38’)...
freeglut-3.8.0/src/fg_init.c:529:35: branch_true: ...to here
freeglut-3.8.0/src/fg_init.c:628:21: throw: if ‘fgWarning’ throws an exception...
freeglut-3.8.0/src/fg_init.c:628:21: danger: ‘buffer’ leaks here; was allocated at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
#  626|                       break;
#  627|                   default:
#  628|->                     fgWarning("WARNING - Only '=' is supported for samples:  %s", token);
#  629|                       break;
#  630|                   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def81]
freeglut-3.8.0/src/fg_init.c:709:21: warning[-Wanalyzer-malloc-leak]: leak of ‘buffer’
freeglut-3.8.0/src/fg_init.c:510:28: acquire_memory: allocated here
freeglut-3.8.0/src/fg_init.c:516:13: branch_true: following ‘true’ branch (when ‘token’ is non-NULL)...
freeglut-3.8.0/src/fg_init.c:525:30: branch_true: ...to here
freeglut-3.8.0/src/fg_init.c:527:22: branch_true: following ‘true’ branch (when ‘i != 38’)...
freeglut-3.8.0/src/fg_init.c:529:35: branch_true: ...to here
freeglut-3.8.0/src/fg_init.c:529:16: branch_false: following ‘false’ branch...
freeglut-3.8.0/src/fg_init.c:527:38: branch_false: ...to here
freeglut-3.8.0/src/fg_init.c:527:22: branch_true: following ‘true’ branch (when ‘i != 38’)...
freeglut-3.8.0/src/fg_init.c:529:35: branch_true: ...to here
freeglut-3.8.0/src/fg_init.c:527:22: branch_true: following ‘true’ branch (when ‘i != 38’)...
freeglut-3.8.0/src/fg_init.c:529:35: branch_true: ...to here
freeglut-3.8.0/src/fg_init.c:709:21: throw: if ‘fgWarning’ throws an exception...
freeglut-3.8.0/src/fg_init.c:709:21: danger: ‘buffer’ leaks here; was allocated at [(1)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/0)
#  707|                       break;
#  708|                   default:
#  709|->                     fgWarning("WARNING - Only '=' is supported for auxbufs:  %s", token);
#  710|                       break;
#  711|                   }

Error: GCC_ANALYZER_WARNING (CWE-476): [#def82]
freeglut-3.8.0/src/fg_joystick.c:624:37: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘calloc(672, 1)’
freeglut-3.8.0/src/fg_joystick.c:621:27: acquire_memory: this call could return NULL
freeglut-3.8.0/src/fg_joystick.c:624:37: danger: ‘calloc(672, 1)’ could be NULL: unchecked value from [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#  622|   
#  623|       /* Set defaults */
#  624|->     fgJoystick[ ident ]->num_axes = fgJoystick[ ident ]->num_buttons = 0;
#  625|       fgJoystick[ ident ]->error = GL_TRUE;
#  626|   

Error: GCC_ANALYZER_WARNING (CWE-404): [#def83]
freeglut-3.8.0/src/fg_main.c:252:9: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
freeglut-3.8.0/src/fg_main.c:247:8: branch_true: following ‘true’ branch...
freeglut-3.8.0/src/fg_main.c:249:9: branch_true: ...to here
freeglut-3.8.0/src/fg_main.c:249:9: acquire_resource: ‘va_start’ called here
freeglut-3.8.0/src/fg_main.c:252:9: throw: if the called function throws an exception...
freeglut-3.8.0/src/fg_main.c:252:9: danger: missing call to ‘va_end’ to match ‘va_start’ at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#  250|   
#  251|           /* call user set error handler here */
#  252|->         fgState.ErrorFunc(fmt, ap, fgState.ErrorFuncData);
#  253|   
#  254|           va_end( ap );

Error: GCC_ANALYZER_WARNING (CWE-404): [#def84]
freeglut-3.8.0/src/fg_main.c:285:9: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’
freeglut-3.8.0/src/fg_main.c:280:8: branch_true: following ‘true’ branch...
freeglut-3.8.0/src/fg_main.c:282:9: branch_true: ...to here
freeglut-3.8.0/src/fg_main.c:282:9: acquire_resource: ‘va_start’ called here
freeglut-3.8.0/src/fg_main.c:285:9: throw: if the called function throws an exception...
freeglut-3.8.0/src/fg_main.c:285:9: danger: missing call to ‘va_end’ to match ‘va_start’ at [(3)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/2)
#  283|   
#  284|           /* call user set warning handler here */
#  285|->         fgState.WarningFunc(fmt, ap, fgState.WarningFuncData);
#  286|   
#  287|           va_end( ap );

Error: GCC_ANALYZER_WARNING (CWE-457): [#def85]
freeglut-3.8.0/src/fg_menu.c:129:1: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘<return-value>’
#  127|           *y = fgDisplay.ScreenHeight;
#  128|       }
#  129|-> }
#  130|   
#  131|   static GLboolean fghCheckMenuStatus( SFG_Menu* menu )

Error: GCC_ANALYZER_WARNING (CWE-476): [#def86]
freeglut-3.8.0/src/fg_menu.c:178:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘entry’
freeglut-3.8.0/src/fg_menu.c:529:11: enter_function: entry to ‘fgCheckActiveMenu’
freeglut-3.8.0/src/fg_menu.c:552:7: branch_true: following ‘true’ branch...
freeglut-3.8.0/src/fg_menu.c:554:23: branch_true: ...to here
freeglut-3.8.0/src/fg_menu.c:563:13: call_function: calling ‘fghCheckMenuStatus’ from ‘fgCheckActiveMenu’
#  176|                                         "fghCheckMenuStatus" );
#  177|   
#  178|->         menuEntry->IsActive = GL_TRUE;
#  179|           menuEntry->Ordinal = menuID;
#  180|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def87]
freeglut-3.8.0/src/fg_menu.c:826:5: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘menuEntry’
freeglut-3.8.0/src/fg_menu.c:821:5: branch_false: following ‘false’ branch...
freeglut-3.8.0/src/fg_menu.c:822:9: branch_false: ...to here
freeglut-3.8.0/src/fg_menu.c:825:34: acquire_memory: this call could return NULL
freeglut-3.8.0/src/fg_menu.c:826:5: danger: ‘menuEntry’ could be NULL: unchecked value from [(3)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/2)
#  824|   
#  825|       menuEntry = (SFG_MenuEntry *)calloc( sizeof(SFG_MenuEntry), 1 );
#  826|->     menuEntry->Text = strdup( label );
#  827|       menuEntry->ID   = value;
#  828|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def88]
freeglut-3.8.0/src/fg_menu.c:830:5: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
freeglut-3.8.0/src/fg_menu.c:821:5: branch_false: following ‘false’ branch...
freeglut-3.8.0/src/fg_menu.c:822:9: branch_false: ...to here
freeglut-3.8.0/src/fg_menu.c:826:23: acquire_memory: allocated here
freeglut-3.8.0/src/fg_menu.c:830:5: throw: if ‘fgListAppend’ throws an exception...
freeglut-3.8.0/src/fg_menu.c:830:5: danger: ‘<unknown>’ leaks here; was allocated at [(3)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/2)
#  828|   
#  829|       /* Have the new menu entry attached to the current menu */
#  830|->     fgListAppend( &fgStructure.CurrentMenu->Entries, &menuEntry->Node );
#  831|   
#  832|       fghCalculateMenuBoxSize( );

Error: GCC_ANALYZER_WARNING (CWE-401): [#def89]
freeglut-3.8.0/src/fg_menu.c:830:5: warning[-Wanalyzer-malloc-leak]: leak of ‘menuEntry’
freeglut-3.8.0/src/fg_menu.c:821:5: branch_false: following ‘false’ branch...
freeglut-3.8.0/src/fg_menu.c:822:9: branch_false: ...to here
freeglut-3.8.0/src/fg_menu.c:825:34: acquire_memory: allocated here
freeglut-3.8.0/src/fg_menu.c:830:5: throw: if ‘fgListAppend’ throws an exception...
freeglut-3.8.0/src/fg_menu.c:830:5: danger: ‘menuEntry’ leaks here; was allocated at [(3)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/2)
#  828|   
#  829|       /* Have the new menu entry attached to the current menu */
#  830|->     fgListAppend( &fgStructure.CurrentMenu->Entries, &menuEntry->Node );
#  831|   
#  832|       fghCalculateMenuBoxSize( );

Error: GCC_ANALYZER_WARNING (CWE-476): [#def90]
freeglut-3.8.0/src/fg_menu.c:851:5: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘menuEntry’
freeglut-3.8.0/src/fg_menu.c:844:5: branch_false: following ‘false’ branch...
freeglut-3.8.0/src/fg_menu.c:845:9: branch_false: ...to here
freeglut-3.8.0/src/fg_menu.c:848:5: branch_false: following ‘false’ branch...
freeglut-3.8.0/src/fg_menu.c:850:36: branch_false: ...to here
freeglut-3.8.0/src/fg_menu.c:850:36: acquire_memory: this call could return NULL
freeglut-3.8.0/src/fg_menu.c:851:5: danger: ‘menuEntry’ could be NULL: unchecked value from [(5)](sarif:/runs/0/results/9/codeFlows/0/threadFlows/0/locations/4)
#  849|   
#  850|       menuEntry = ( SFG_MenuEntry * )calloc( sizeof( SFG_MenuEntry ), 1 );
#  851|->     menuEntry->Text    = strdup( label );
#  852|       menuEntry->SubMenu = subMenu;
#  853|       menuEntry->ID      = -1;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def91]
freeglut-3.8.0/src/fg_menu.c:855:5: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
freeglut-3.8.0/src/fg_menu.c:844:5: branch_false: following ‘false’ branch...
freeglut-3.8.0/src/fg_menu.c:845:9: branch_false: ...to here
freeglut-3.8.0/src/fg_menu.c:848:5: branch_false: following ‘false’ branch...
freeglut-3.8.0/src/fg_menu.c:850:36: branch_false: ...to here
freeglut-3.8.0/src/fg_menu.c:851:26: acquire_memory: allocated here
freeglut-3.8.0/src/fg_menu.c:855:5: throw: if ‘fgListAppend’ throws an exception...
freeglut-3.8.0/src/fg_menu.c:855:5: danger: ‘<unknown>’ leaks here; was allocated at [(5)](sarif:/runs/0/results/10/codeFlows/0/threadFlows/0/locations/4)
#  853|       menuEntry->ID      = -1;
#  854|   
#  855|->     fgListAppend( &fgStructure.CurrentMenu->Entries, &menuEntry->Node );
#  856|       fghCalculateMenuBoxSize( );
#  857|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def92]
freeglut-3.8.0/src/fg_menu.c:855:5: warning[-Wanalyzer-malloc-leak]: leak of ‘menuEntry’
freeglut-3.8.0/src/fg_menu.c:844:5: branch_false: following ‘false’ branch...
freeglut-3.8.0/src/fg_menu.c:845:9: branch_false: ...to here
freeglut-3.8.0/src/fg_menu.c:848:5: branch_false: following ‘false’ branch...
freeglut-3.8.0/src/fg_menu.c:850:36: branch_false: ...to here
freeglut-3.8.0/src/fg_menu.c:850:36: acquire_memory: allocated here
freeglut-3.8.0/src/fg_menu.c:855:5: throw: if ‘fgListAppend’ throws an exception...
freeglut-3.8.0/src/fg_menu.c:855:5: danger: ‘menuEntry’ leaks here; was allocated at [(5)](sarif:/runs/0/results/11/codeFlows/0/threadFlows/0/locations/4)
#  853|       menuEntry->ID      = -1;
#  854|   
#  855|->     fgListAppend( &fgStructure.CurrentMenu->Entries, &menuEntry->Node );
#  856|       fghCalculateMenuBoxSize( );
#  857|   }

Error: COMPILER_WARNING (CWE-1164): [#def93]
freeglut-3.8.0/src/x11/fg_gamemode_x11.c:31:12: warning[-Wunused-function]: ‘use_xrandr’ defined but not used
#   31 | static int use_xrandr(void)
#      |            ^~~~~~~~~~
#   29|    * hasn't explicitly disabled it by setting the FREEGLUT_NO_XRANDR env-var.
#   30|    */
#   31|-> static int use_xrandr(void)
#   32|   {
#   33|   #ifdef HAVE_X11_EXTENSIONS_XRANDR_H

Error: COMPILER_WARNING (CWE-1164): [#def94]
freeglut-3.8.0/src/x11/fg_gamemode_x11.c:50:12: warning[-Wunused-function]: ‘use_xf86vm’ defined but not used
#   50 | static int use_xf86vm(void)
#      |            ^~~~~~~~~~
#   48|    * user hasn't explicitly disabled it by setting the FREEGLUT_NO_XF86VM env-var.
#   49|    */
#   50|-> static int use_xf86vm(void)
#   51|   {
#   52|   #ifdef HAVE_X11_EXTENSIONS_XF86VMODE_H

Error: GCC_ANALYZER_WARNING (CWE-401): [#def95]
freeglut-3.8.0/src/x11/fg_init_x11.c:63:12: warning[-Wanalyzer-malloc-leak]: leak of ‘window_ptr_1’
freeglut-3.8.0/src/x11/fg_init_x11.c:89:12: enter_function: entry to ‘fghNetWMSupported’
freeglut-3.8.0/src/x11/fg_init_x11.c:101:18: acquire_memory: allocated here
freeglut-3.8.0/src/x11/fg_init_x11.c:107:23: call_function: calling ‘fghGetWindowProperty’ from ‘fghNetWMSupported’
#   61|   
#   62|   
#   63|->   status = XGetWindowProperty(fgDisplay.pDisplay.Display,
#   64|   			      window,
#   65|   			      property,

Error: GCC_ANALYZER_WARNING (CWE-401): [#def96]
freeglut-3.8.0/src/x11/fg_init_x11.c:63:12: warning[-Wanalyzer-malloc-leak]: leak of ‘window_ptr_2’
freeglut-3.8.0/src/x11/fg_init_x11.c:89:12: enter_function: entry to ‘fghNetWMSupported’
freeglut-3.8.0/src/x11/fg_init_x11.c:107:23: call_function: calling ‘fghGetWindowProperty’ from ‘fghNetWMSupported’
freeglut-3.8.0/src/x11/fg_init_x11.c:107:23: return_function: returning to ‘fghNetWMSupported’ from ‘fghGetWindowProperty’
freeglut-3.8.0/src/x11/fg_init_x11.c:111:6: branch_true: following ‘true’ branch...
freeglut-3.8.0/src/x11/fg_init_x11.c:115:20: branch_true: ...to here
freeglut-3.8.0/src/x11/fg_init_x11.c:115:20: acquire_memory: allocated here
freeglut-3.8.0/src/x11/fg_init_x11.c:118:25: call_function: calling ‘fghGetWindowProperty’ from ‘fghNetWMSupported’
#   61|   
#   62|   
#   63|->   status = XGetWindowProperty(fgDisplay.pDisplay.Display,
#   64|   			      window,
#   65|   			      property,

Error: GCC_ANALYZER_WARNING (CWE-476): [#def97]
freeglut-3.8.0/src/x11/fg_input_devices_x11.c:71:5: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘port’
freeglut-3.8.0/src/x11/fg_input_devices_x11.c:64:8: branch_false: following ‘false’ branch...
freeglut-3.8.0/src/x11/fg_input_devices_x11.c:69:12: branch_false: ...to here
freeglut-3.8.0/src/x11/fg_input_devices_x11.c:69:12: acquire_memory: this call could return NULL
freeglut-3.8.0/src/x11/fg_input_devices_x11.c:71:5: danger: ‘port’ could be NULL: unchecked value from [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
#   69|       port = malloc(sizeof(SERIALPORT));
#   70|       memset(port, 0, sizeof(SERIALPORT));
#   71|->     port->fd = fd;
#   72|   
#   73|       /* save current port settings */

Error: GCC_ANALYZER_WARNING (CWE-457): [#def98]
freeglut-3.8.0/src/x11/fg_menu_x11.c:42:1: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘<return-value>’
#   40|       *x = fgState.GameModeSize.X + wx;
#   41|       *y = fgState.GameModeSize.Y + wy;
#   42|-> }
#   43|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def99]
freeglut-3.8.0/src/x11/fg_state_x11_glx.c:213:24: warning[-Wanalyzer-malloc-leak]: leak of ‘temp_array’
freeglut-3.8.0/src/x11/fg_state_x11_glx.c:199:10: branch_true: following ‘true’ branch...
freeglut-3.8.0/src/x11/fg_state_x11_glx.c:206:24: branch_true: ...to here
freeglut-3.8.0/src/x11/fg_state_x11_glx.c:206:24: acquire_memory: allocated here
freeglut-3.8.0/src/x11/fg_state_x11_glx.c:209:23: branch_true: following ‘true’ branch...
freeglut-3.8.0/src/x11/fg_state_x11_glx.c:214:58: branch_true: ...to here
freeglut-3.8.0/src/x11/fg_state_x11_glx.c:213:24: throw: if ‘glXGetFBConfigAttrib’ throws an exception...
freeglut-3.8.0/src/x11/fg_state_x11_glx.c:213:24: danger: ‘temp_array’ leaks here; was allocated at [(5)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/4)
#  211|                 int value;
#  212|   
#  213|->               result = glXGetFBConfigAttrib(fgDisplay.pDisplay.Display,
#  214|                                               fbconfigArray[i],
#  215|                                               attribute_name,

Error: GCC_ANALYZER_WARNING (CWE-476): [#def100]
freeglut-3.8.0/src/x11/fg_state_x11_glx.c:228:15: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘array’
freeglut-3.8.0/src/x11/fg_state_x11_glx.c:199:10: branch_true: following ‘true’ branch...
freeglut-3.8.0/src/x11/fg_state_x11_glx.c:206:24: branch_true: ...to here
freeglut-3.8.0/src/x11/fg_state_x11_glx.c:225:19: acquire_memory: this call could return NULL
freeglut-3.8.0/src/x11/fg_state_x11_glx.c:226:23: branch_true: following ‘true’ branch...
freeglut-3.8.0/src/x11/fg_state_x11_glx.c:228:36: branch_true: ...to here
freeglut-3.8.0/src/x11/fg_state_x11_glx.c:228:15: danger: ‘array + (long unsigned int)i * 4’ could be NULL: unchecked value from [(5)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/4)
#  226|             for (i = 0; i < *size; i++)
#  227|               {
#  228|->               array[i] = temp_array[i];
#  229|               }
#  230|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def101]
freeglut-3.8.0/src/x11/fg_state_x11_glx.c:228:26: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘temp_array’
freeglut-3.8.0/src/x11/fg_state_x11_glx.c:199:10: branch_true: following ‘true’ branch...
freeglut-3.8.0/src/x11/fg_state_x11_glx.c:206:24: branch_true: ...to here
freeglut-3.8.0/src/x11/fg_state_x11_glx.c:206:24: acquire_memory: this call could return NULL
freeglut-3.8.0/src/x11/fg_state_x11_glx.c:226:23: branch_true: following ‘true’ branch...
freeglut-3.8.0/src/x11/fg_state_x11_glx.c:228:36: branch_true: ...to here
freeglut-3.8.0/src/x11/fg_state_x11_glx.c:228:26: danger: ‘temp_array + (long unsigned int)i * 4’ could be NULL: unchecked value from [(5)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/4)
#  226|             for (i = 0; i < *size; i++)
#  227|               {
#  228|->               array[i] = temp_array[i];
#  229|               }
#  230|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def102]
freeglut-3.8.0/src/x11/fg_state_x11_glx.c:232:11: warning[-Wanalyzer-malloc-leak]: leak of ‘array’
freeglut-3.8.0/src/x11/fg_state_x11_glx.c:199:10: branch_true: following ‘true’ branch...
freeglut-3.8.0/src/x11/fg_state_x11_glx.c:206:24: branch_true: ...to here
freeglut-3.8.0/src/x11/fg_state_x11_glx.c:225:19: acquire_memory: allocated here
freeglut-3.8.0/src/x11/fg_state_x11_glx.c:226:23: branch_false: following ‘false’ branch...
freeglut-3.8.0/src/x11/fg_state_x11_glx.c:231:11: branch_false: ...to here
freeglut-3.8.0/src/x11/fg_state_x11_glx.c:232:11: throw: if ‘XFree’ throws an exception...
freeglut-3.8.0/src/x11/fg_state_x11_glx.c:232:11: danger: ‘array’ leaks here; was allocated at [(5)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/4)
#  230|   
#  231|             free(temp_array);
#  232|->           XFree(fbconfigArray);
#  233|           }
#  234|   

Scan Properties

analyzer-version-clippy1.92.0
analyzer-version-cppcheck2.19.1
analyzer-version-gcc16.0.0
analyzer-version-gcc-analyzer16.0.0
analyzer-version-shellcheck0.11.0
analyzer-version-unicontrol0.0.2
enabled-pluginsclippy, cppcheck, gcc, shellcheck, unicontrol
exit-code0
hostip-172-16-1-189.us-west-2.compute.internal
known-false-positives/usr/share/csmock/known-false-positives.js
known-false-positives-rpmknown-false-positives-0.0.0.20250521.132812.g8eff701.main-1.el9.noarch
mock-configfedora-rawhide-x86_64
project-namefreeglut-3.8.0-1.fc44
store-results-to/tmp/tmpzclszfw1/freeglut-3.8.0-1.fc44.tar.xz
time-created2026-01-08 16:10:03
time-finished2026-01-08 16:11:27
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'gcc,cppcheck,clippy,shellcheck,unicontrol' '-o' '/tmp/tmpzclszfw1/freeglut-3.8.0-1.fc44.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '--gcc-analyzer-bin=/usr/bin/gcc' '/tmp/tmpzclszfw1/freeglut-3.8.0-1.fc44.src.rpm'
tool-versioncsmock-3.8.3.20251215.161544.g62de9a5-1.el9