Error: GCC_ANALYZER_WARNING (CWE-401): [#def1] Pillow-12.1.0/src/_imaging.c:267:15: warning[-Wanalyzer-malloc-leak]: leak of ‘schema’ Pillow-12.1.0/src/_imaging.c:266:31: acquire_memory: allocated here Pillow-12.1.0/src/_imaging.c:267:15: throw: if ‘export_imaging_schema’ throws an exception... Pillow-12.1.0/src/_imaging.c:267:15: danger: ‘schema’ leaks here; was allocated at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0) # 265| struct ArrowSchema *schema = # 266| (struct ArrowSchema *)calloc(1, sizeof(struct ArrowSchema)); # 267|-> int err = export_imaging_schema(self->image, schema); # 268| if (err == 0) { # 269| return PyCapsule_New(schema, "arrow_schema", ReleaseArrowSchemaPyCapsule); Error: GCC_ANALYZER_WARNING (CWE-401): [#def2] Pillow-12.1.0/src/_imaging.c:289:15: warning[-Wanalyzer-malloc-leak]: leak of ‘array’ Pillow-12.1.0/src/_imaging.c:288:30: acquire_memory: allocated here Pillow-12.1.0/src/_imaging.c:289:15: throw: if ‘export_imaging_array’ throws an exception... Pillow-12.1.0/src/_imaging.c:289:15: danger: ‘array’ leaks here; was allocated at [(1)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/0) # 287| struct ArrowArray *array = # 288| (struct ArrowArray *)calloc(1, sizeof(struct ArrowArray)); # 289|-> int err = export_imaging_array(self->image, array); # 290| if (err == 0) { # 291| return PyCapsule_New(array, "arrow_array", ReleaseArrowArrayPyCapsule); Error: GCC_ANALYZER_WARNING (CWE-401): [#def3] Pillow-12.1.0/src/_imaging.c:435:11: warning[-Wanalyzer-malloc-leak]: leak of ‘list’ Pillow-12.1.0/src/_imaging.c:417:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/_imaging.c:422:9: branch_false: ...to here Pillow-12.1.0/src/_imaging.c:430:12: acquire_memory: allocated here Pillow-12.1.0/src/_imaging.c:431:8: branch_false: following ‘false’ branch (when ‘list’ is non-NULL)... Pillow-12.1.0/src/_imaging.c:435:11: branch_false: ...to here Pillow-12.1.0/src/_imaging.c:435:11: throw: if ‘PySequence_Fast’ throws an exception... Pillow-12.1.0/src/_imaging.c:435:11: danger: ‘list’ leaks here; was allocated at [(3)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/2) # 433| } # 434| # 435|-> seq = PySequence_Fast(arg, must_be_sequence); # 436| if (!seq) { # 437| free(list); Error: GCC_ANALYZER_WARNING (CWE-401): [#def4] Pillow-12.1.0/src/_imaging.c:447:25: warning[-Wanalyzer-malloc-leak]: leak of ‘list’ Pillow-12.1.0/src/_imaging.c:398:1: enter_function: entry to ‘getlist’ Pillow-12.1.0/src/_imaging.c:417:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/_imaging.c:422:9: branch_false: ...to here Pillow-12.1.0/src/_imaging.c:430:12: acquire_memory: allocated here Pillow-12.1.0/src/_imaging.c:431:8: branch_false: following ‘false’ branch (when ‘list’ is non-NULL)... Pillow-12.1.0/src/_imaging.c:435:11: branch_false: ...to here Pillow-12.1.0/src/_imaging.c:436:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/_imaging.c:436:8: branch_false: ...to here Pillow-12.1.0/src/_imaging.c:441:17: branch_true: following ‘true’ branch... Pillow-12.1.0/src/_imaging.c:442:14: call_function: inlined call to ‘_Py_TYPE’ from ‘getlist’ Pillow-12.1.0/src/_imaging.c:442:14: branch_true: following ‘true’ branch... Pillow-12.1.0/src/_imaging.c:442:9: branch_true: ...to here Pillow-12.1.0/src/_imaging.c:447:25: throw: if ‘PyLong_AsLong’ throws an exception... Pillow-12.1.0/src/_imaging.c:447:25: danger: ‘list’ leaks here; was allocated at [(4)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/3) # 445| switch (type) { # 446| case TYPE_UINT8: # 447|-> itemp = PyLong_AsLong(op); # 448| list[i] = CLIP8(itemp); # 449| break; Error: GCC_ANALYZER_WARNING (CWE-401): [#def5] Pillow-12.1.0/src/_imaging.c:451:25: warning[-Wanalyzer-malloc-leak]: leak of ‘list’ Pillow-12.1.0/src/_imaging.c:398:1: enter_function: entry to ‘getlist’ Pillow-12.1.0/src/_imaging.c:417:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/_imaging.c:422:9: branch_false: ...to here Pillow-12.1.0/src/_imaging.c:430:12: acquire_memory: allocated here Pillow-12.1.0/src/_imaging.c:431:8: branch_false: following ‘false’ branch (when ‘list’ is non-NULL)... Pillow-12.1.0/src/_imaging.c:435:11: branch_false: ...to here Pillow-12.1.0/src/_imaging.c:436:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/_imaging.c:436:8: branch_false: ...to here Pillow-12.1.0/src/_imaging.c:441:17: branch_true: following ‘true’ branch... Pillow-12.1.0/src/_imaging.c:442:14: call_function: inlined call to ‘_Py_TYPE’ from ‘getlist’ Pillow-12.1.0/src/_imaging.c:442:14: branch_true: following ‘true’ branch... Pillow-12.1.0/src/_imaging.c:442:9: branch_true: ...to here Pillow-12.1.0/src/_imaging.c:451:25: throw: if ‘PyLong_AsLong’ throws an exception... Pillow-12.1.0/src/_imaging.c:451:25: danger: ‘list’ leaks here; was allocated at [(4)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/3) # 449| break; # 450| case TYPE_INT32: # 451|-> itemp = PyLong_AsLong(op); # 452| memcpy(list + i * sizeof(INT32), &itemp, sizeof(itemp)); # 453| break; Error: GCC_ANALYZER_WARNING (CWE-401): [#def6] Pillow-12.1.0/src/_imaging.c:455:34: warning[-Wanalyzer-malloc-leak]: leak of ‘list’ Pillow-12.1.0/src/_imaging.c:398:1: enter_function: entry to ‘getlist’ Pillow-12.1.0/src/_imaging.c:417:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/_imaging.c:422:9: branch_false: ...to here Pillow-12.1.0/src/_imaging.c:430:12: acquire_memory: allocated here Pillow-12.1.0/src/_imaging.c:431:8: branch_false: following ‘false’ branch (when ‘list’ is non-NULL)... Pillow-12.1.0/src/_imaging.c:435:11: branch_false: ...to here Pillow-12.1.0/src/_imaging.c:436:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/_imaging.c:436:8: branch_false: ...to here Pillow-12.1.0/src/_imaging.c:441:17: branch_true: following ‘true’ branch... Pillow-12.1.0/src/_imaging.c:442:14: call_function: inlined call to ‘_Py_TYPE’ from ‘getlist’ Pillow-12.1.0/src/_imaging.c:442:14: branch_true: following ‘true’ branch... Pillow-12.1.0/src/_imaging.c:442:9: branch_true: ...to here Pillow-12.1.0/src/_imaging.c:455:34: throw: if ‘PyFloat_AsDouble’ throws an exception... Pillow-12.1.0/src/_imaging.c:455:34: danger: ‘list’ leaks here; was allocated at [(4)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/3) # 453| break; # 454| case TYPE_FLOAT32: # 455|-> ftemp = (FLOAT32)PyFloat_AsDouble(op); # 456| memcpy(list + i * sizeof(ftemp), &ftemp, sizeof(ftemp)); # 457| break; Error: GCC_ANALYZER_WARNING (CWE-401): [#def7] Pillow-12.1.0/src/_imaging.c:459:25: warning[-Wanalyzer-malloc-leak]: leak of ‘list’ Pillow-12.1.0/src/_imaging.c:398:1: enter_function: entry to ‘getlist’ Pillow-12.1.0/src/_imaging.c:417:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/_imaging.c:422:9: branch_false: ...to here Pillow-12.1.0/src/_imaging.c:430:12: acquire_memory: allocated here Pillow-12.1.0/src/_imaging.c:431:8: branch_false: following ‘false’ branch (when ‘list’ is non-NULL)... Pillow-12.1.0/src/_imaging.c:435:11: branch_false: ...to here Pillow-12.1.0/src/_imaging.c:436:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/_imaging.c:436:8: branch_false: ...to here Pillow-12.1.0/src/_imaging.c:441:17: branch_true: following ‘true’ branch... Pillow-12.1.0/src/_imaging.c:442:14: call_function: inlined call to ‘_Py_TYPE’ from ‘getlist’ Pillow-12.1.0/src/_imaging.c:442:14: branch_true: following ‘true’ branch... Pillow-12.1.0/src/_imaging.c:442:9: branch_true: ...to here Pillow-12.1.0/src/_imaging.c:459:25: throw: if ‘PyFloat_AsDouble’ throws an exception... Pillow-12.1.0/src/_imaging.c:459:25: danger: ‘list’ leaks here; was allocated at [(4)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/3) # 457| break; # 458| case TYPE_DOUBLE: # 459|-> dtemp = PyFloat_AsDouble(op); # 460| memcpy(list + i * sizeof(dtemp), &dtemp, sizeof(dtemp)); # 461| break; Error: GCC_ANALYZER_WARNING (CWE-401): [#def8] Pillow-12.1.0/src/_imaging.c:467:9: warning[-Wanalyzer-malloc-leak]: leak of ‘list’ Pillow-12.1.0/src/_imaging.c:398:1: enter_function: entry to ‘getlist’ Pillow-12.1.0/src/_imaging.c:417:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/_imaging.c:422:9: branch_false: ...to here Pillow-12.1.0/src/_imaging.c:430:12: acquire_memory: allocated here Pillow-12.1.0/src/_imaging.c:431:8: branch_false: following ‘false’ branch (when ‘list’ is non-NULL)... Pillow-12.1.0/src/_imaging.c:435:11: branch_false: ...to here Pillow-12.1.0/src/_imaging.c:436:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/_imaging.c:436:8: branch_false: ...to here Pillow-12.1.0/src/_imaging.c:465:5: call_function: inlined call to ‘Py_DECREF’ from ‘getlist’ Pillow-12.1.0/src/_imaging.c:467:9: branch_true: ...to here Pillow-12.1.0/src/_imaging.c:467:9: throw: if ‘PyErr_Occurred’ throws an exception... Pillow-12.1.0/src/_imaging.c:467:9: danger: ‘list’ leaks here; was allocated at [(4)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/3) # 465| Py_DECREF(seq); # 466| # 467|-> if (PyErr_Occurred()) { # 468| free(list); # 469| return NULL; Error: GCC_ANALYZER_WARNING (CWE-401): [#def9] Pillow-12.1.0/src/_imaging.c:2350:5: warning[-Wanalyzer-malloc-leak]: leak of ‘xprofile’ Pillow-12.1.0/src/_imaging.c:2341:16: acquire_memory: allocated here Pillow-12.1.0/src/_imaging.c:2344:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/_imaging.c:2350:5: branch_false: ...to here Pillow-12.1.0/src/_imaging.c:2350:5: throw: if ‘ImagingGetProjection’ throws an exception... Pillow-12.1.0/src/_imaging.c:2350:5: danger: ‘xprofile’ leaks here; was allocated at [(1)](sarif:/runs/0/results/9/codeFlows/0/threadFlows/0/locations/0) # 2348| } # 2349| # 2350|-> ImagingGetProjection( # 2351| self->image, (unsigned char *)xprofile, (unsigned char *)yprofile # 2352| ); Error: GCC_ANALYZER_WARNING (CWE-401): [#def10] Pillow-12.1.0/src/_imaging.c:2350:5: warning[-Wanalyzer-malloc-leak]: leak of ‘yprofile’ Pillow-12.1.0/src/_imaging.c:2342:16: acquire_memory: allocated here Pillow-12.1.0/src/_imaging.c:2344:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/_imaging.c:2350:5: branch_false: ...to here Pillow-12.1.0/src/_imaging.c:2350:5: throw: if ‘ImagingGetProjection’ throws an exception... Pillow-12.1.0/src/_imaging.c:2350:5: danger: ‘yprofile’ leaks here; was allocated at [(1)](sarif:/runs/0/results/10/codeFlows/0/threadFlows/0/locations/0) # 2348| } # 2349| # 2350|-> ImagingGetProjection( # 2351| self->image, (unsigned char *)xprofile, (unsigned char *)yprofile # 2352| ); Error: GCC_ANALYZER_WARNING (CWE-457): [#def11] Pillow-12.1.0/src/_imaging.c:2788:9: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘buffer’ Pillow-12.1.0/src/_imaging.c:2767:1: enter_function: entry to ‘_font_text_asBytes’ Pillow-12.1.0/src/_imaging.c:2776:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/_imaging.c:2782:16: call_function: inlined call to ‘PyType_HasFeature’ from ‘_font_text_asBytes’ Pillow-12.1.0/src/_imaging.c:2782:15: branch_false: following ‘false’ branch... Pillow-12.1.0/src/_imaging.c:2786:20: branch_false: ...to here Pillow-12.1.0/src/_imaging.c:2787:8: branch_true: following ‘true’ branch... Pillow-12.1.0/src/_imaging.c:2788:9: branch_true: ...to here Pillow-12.1.0/src/_imaging.c:2788:9: danger: use of uninitialized value ‘buffer’ here # 2786| *text = calloc(len + 1, 1); # 2787| if (*text) { # 2788|-> memcpy(*text, buffer, len); # 2789| } else { # 2790| ImagingError_MemoryError(); Error: GCC_ANALYZER_WARNING (CWE-401): [#def12] Pillow-12.1.0/src/_imaging.c:3371:9: warning[-Wanalyzer-malloc-leak]: leak of ‘ixy’ Pillow-12.1.0/src/_imaging.c:3339:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/_imaging.c:3345:9: branch_false: ...to here Pillow-12.1.0/src/_imaging.c:3346:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/_imaging.c:3349:8: branch_false: ...to here Pillow-12.1.0/src/_imaging.c:3349:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/_imaging.c:3358:18: branch_false: ...to here Pillow-12.1.0/src/_imaging.c:3358:18: acquire_memory: allocated here Pillow-12.1.0/src/_imaging.c:3359:8: branch_false: following ‘false’ branch (when ‘ixy’ is non-NULL)... Pillow-12.1.0/src/_imaging.c:3359:8: branch_false: ...to here Pillow-12.1.0/src/_imaging.c:3364:17: branch_true: following ‘true’ branch... Pillow-12.1.0/src/_imaging.c:3365:29: branch_true: ...to here Pillow-12.1.0/src/_imaging.c:3364:17: branch_true: following ‘true’ branch... Pillow-12.1.0/src/_imaging.c:3365:29: branch_true: ...to here Pillow-12.1.0/src/_imaging.c:3371:9: branch_false: following ‘false’ branch... Pillow-12.1.0/src/_imaging.c:3371:9: branch_false: ...to here Pillow-12.1.0/src/_imaging.c:3371:9: throw: if ‘ImagingDrawPolygon’ throws an exception... Pillow-12.1.0/src/_imaging.c:3371:9: danger: ‘ixy’ leaks here; was allocated at [(7)](sarif:/runs/0/results/12/codeFlows/0/threadFlows/0/locations/6) # 3369| free(xy); # 3370| # 3371|-> if (ImagingDrawPolygon( # 3372| self->image->image, # 3373| n, Error: GCC_ANALYZER_WARNING (CWE-401): [#def13] Pillow-12.1.0/src/_imagingcms.c:707:5: warning[-Wanalyzer-malloc-leak]: leak of ‘buf’ Pillow-12.1.0/src/_imagingcms.c:690:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/_imagingcms.c:694:11: branch_false: ...to here Pillow-12.1.0/src/_imagingcms.c:695:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/_imagingcms.c:699:11: branch_false: ...to here Pillow-12.1.0/src/_imagingcms.c:699:11: acquire_memory: allocated here Pillow-12.1.0/src/_imagingcms.c:700:8: branch_false: following ‘false’ branch (when ‘buf’ is non-NULL)... Pillow-12.1.0/src/_imagingcms.c:705:5: branch_false: ...to here Pillow-12.1.0/src/_imagingcms.c:707:5: throw: if ‘cmsMLUgetWide’ throws an exception... Pillow-12.1.0/src/_imagingcms.c:707:5: danger: ‘buf’ leaks here; was allocated at [(5)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/4) # 705| buf[0] = '\0'; # 706| # 707|-> cmsMLUgetWide(mlu, lc, cc, buf, len); # 708| // buf contains additional junk after \0 # 709| uni = PyUnicode_FromWideChar(buf, wcslen(buf)); Error: GCC_ANALYZER_WARNING (CWE-401): [#def14] Pillow-12.1.0/src/_imagingft.c:1412:16: warning[-Wanalyzer-malloc-leak]: leak of ‘coords’ Pillow-12.1.0/src/_imagingft.c:1397:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/_imagingft.c:1401:10: branch_false: ...to here Pillow-12.1.0/src/_imagingft.c:1401:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/_imagingft.c:1406:18: branch_false: ...to here Pillow-12.1.0/src/_imagingft.c:1407:26: acquire_memory: allocated here Pillow-12.1.0/src/_imagingft.c:1408:8: branch_false: following ‘false’ branch (when ‘coords’ is non-NULL)... Pillow-12.1.0/src/_imagingft.c:1408:8: branch_false: ...to here Pillow-12.1.0/src/_imagingft.c:1411:17: branch_true: following ‘true’ branch... Pillow-12.1.0/src/_imagingft.c:1412:16: branch_true: ...to here Pillow-12.1.0/src/_imagingft.c:1412:16: throw: if ‘PyList_GetItemRef’ throws an exception... Pillow-12.1.0/src/_imagingft.c:1412:16: danger: ‘coords’ leaks here; was allocated at [(5)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/4) # 1410| } # 1411| for (i = 0; i < num_coords; i++) { # 1412|-> item = PyList_GetItemRef(axes, i); # 1413| if (item == NULL) { # 1414| free(coords); Error: GCC_ANALYZER_WARNING (CWE-401): [#def15] Pillow-12.1.0/src/_imagingft.c:1421:28: warning[-Wanalyzer-malloc-leak]: leak of ‘coords’ Pillow-12.1.0/src/_imagingft.c:1397:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/_imagingft.c:1401:10: branch_false: ...to here Pillow-12.1.0/src/_imagingft.c:1401:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/_imagingft.c:1406:18: branch_false: ...to here Pillow-12.1.0/src/_imagingft.c:1407:26: acquire_memory: allocated here Pillow-12.1.0/src/_imagingft.c:1408:8: branch_false: following ‘false’ branch (when ‘coords’ is non-NULL)... Pillow-12.1.0/src/_imagingft.c:1408:8: branch_false: ...to here Pillow-12.1.0/src/_imagingft.c:1411:17: branch_true: following ‘true’ branch... Pillow-12.1.0/src/_imagingft.c:1412:16: branch_true: ...to here Pillow-12.1.0/src/_imagingft.c:1413:12: branch_false: following ‘false’ branch... Pillow-12.1.0/src/_imagingft.c:1418:13: branch_false: ...to here Pillow-12.1.0/src/_imagingft.c:1420:19: branch_true: following ‘true’ branch... Pillow-12.1.0/src/_imagingft.c:1421:28: branch_true: ...to here Pillow-12.1.0/src/_imagingft.c:1421:28: throw: if ‘PyLong_AsLong’ throws an exception... Pillow-12.1.0/src/_imagingft.c:1421:28: danger: ‘coords’ leaks here; was allocated at [(5)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/4) # 1419| coord = PyFloat_AS_DOUBLE(item); # 1420| } else if (PyLong_Check(item)) { # 1421|-> coord = (float)PyLong_AS_LONG(item); # 1422| } else if (PyNumber_Check(item)) { # 1423| coord = PyFloat_AsDouble(item); Error: GCC_ANALYZER_WARNING (CWE-401): [#def16] Pillow-12.1.0/src/_imagingft.c:1422:20: warning[-Wanalyzer-malloc-leak]: leak of ‘coords’ Pillow-12.1.0/src/_imagingft.c:1397:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/_imagingft.c:1401:10: branch_false: ...to here Pillow-12.1.0/src/_imagingft.c:1401:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/_imagingft.c:1406:18: branch_false: ...to here Pillow-12.1.0/src/_imagingft.c:1407:26: acquire_memory: allocated here Pillow-12.1.0/src/_imagingft.c:1408:8: branch_false: following ‘false’ branch (when ‘coords’ is non-NULL)... Pillow-12.1.0/src/_imagingft.c:1408:8: branch_false: ...to here Pillow-12.1.0/src/_imagingft.c:1411:17: branch_true: following ‘true’ branch... Pillow-12.1.0/src/_imagingft.c:1412:16: branch_true: ...to here Pillow-12.1.0/src/_imagingft.c:1413:12: branch_false: following ‘false’ branch... Pillow-12.1.0/src/_imagingft.c:1418:13: branch_false: ...to here Pillow-12.1.0/src/_imagingft.c:1420:19: branch_false: following ‘false’ branch... Pillow-12.1.0/src/_imagingft.c:1422:20: branch_false: ...to here Pillow-12.1.0/src/_imagingft.c:1422:20: throw: if ‘PyNumber_Check’ throws an exception... Pillow-12.1.0/src/_imagingft.c:1422:20: danger: ‘coords’ leaks here; was allocated at [(5)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/4) # 1420| } else if (PyLong_Check(item)) { # 1421| coord = (float)PyLong_AS_LONG(item); # 1422|-> } else if (PyNumber_Check(item)) { # 1423| coord = PyFloat_AsDouble(item); # 1424| } else { Error: GCC_ANALYZER_WARNING (CWE-401): [#def17] Pillow-12.1.0/src/_imagingft.c:1423:21: warning[-Wanalyzer-malloc-leak]: leak of ‘coords’ Pillow-12.1.0/src/_imagingft.c:1397:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/_imagingft.c:1401:10: branch_false: ...to here Pillow-12.1.0/src/_imagingft.c:1401:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/_imagingft.c:1406:18: branch_false: ...to here Pillow-12.1.0/src/_imagingft.c:1407:26: acquire_memory: allocated here Pillow-12.1.0/src/_imagingft.c:1408:8: branch_false: following ‘false’ branch (when ‘coords’ is non-NULL)... Pillow-12.1.0/src/_imagingft.c:1408:8: branch_false: ...to here Pillow-12.1.0/src/_imagingft.c:1411:17: branch_true: following ‘true’ branch... Pillow-12.1.0/src/_imagingft.c:1412:16: branch_true: ...to here Pillow-12.1.0/src/_imagingft.c:1413:12: branch_false: following ‘false’ branch... Pillow-12.1.0/src/_imagingft.c:1418:13: branch_false: ...to here Pillow-12.1.0/src/_imagingft.c:1420:19: branch_false: following ‘false’ branch... Pillow-12.1.0/src/_imagingft.c:1422:20: branch_false: ...to here Pillow-12.1.0/src/_imagingft.c:1422:19: branch_true: following ‘true’ branch... Pillow-12.1.0/src/_imagingft.c:1423:21: branch_true: ...to here Pillow-12.1.0/src/_imagingft.c:1423:21: throw: if ‘PyFloat_AsDouble’ throws an exception... Pillow-12.1.0/src/_imagingft.c:1423:21: danger: ‘coords’ leaks here; was allocated at [(5)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/4) # 1421| coord = (float)PyLong_AS_LONG(item); # 1422| } else if (PyNumber_Check(item)) { # 1423|-> coord = PyFloat_AsDouble(item); # 1424| } else { # 1425| Py_DECREF(item); Error: GCC_ANALYZER_WARNING (CWE-401): [#def18] Pillow-12.1.0/src/_imagingft.c:1434:13: warning[-Wanalyzer-malloc-leak]: leak of ‘coords’ Pillow-12.1.0/src/_imagingft.c:1397:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/_imagingft.c:1401:10: branch_false: ...to here Pillow-12.1.0/src/_imagingft.c:1401:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/_imagingft.c:1406:18: branch_false: ...to here Pillow-12.1.0/src/_imagingft.c:1407:26: acquire_memory: allocated here Pillow-12.1.0/src/_imagingft.c:1408:8: branch_false: following ‘false’ branch (when ‘coords’ is non-NULL)... Pillow-12.1.0/src/_imagingft.c:1408:8: branch_false: ...to here Pillow-12.1.0/src/_imagingft.c:1434:13: throw: if ‘FT_Set_Var_Design_Coordinates’ throws an exception... Pillow-12.1.0/src/_imagingft.c:1434:13: danger: ‘coords’ leaks here; was allocated at [(5)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/4) # 1432| } # 1433| # 1434|-> error = FT_Set_Var_Design_Coordinates(self->face, num_coords, coords); # 1435| free(coords); # 1436| if (error) { Error: GCC_ANALYZER_WARNING (CWE-401): [#def19] Pillow-12.1.0/src/encode.c:59:9: warning[-Wanalyzer-malloc-leak]: leak of ‘dictionary’ Pillow-12.1.0/src/encode.c:576:1: enter_function: entry to ‘PyImaging_ZipEncoderNew’ Pillow-12.1.0/src/encode.c:586:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/encode.c:601:9: branch_false: ...to here Pillow-12.1.0/src/encode.c:601:8: branch_true: following ‘true’ branch... Pillow-12.1.0/src/encode.c:603:19: acquire_memory: allocated here Pillow-12.1.0/src/encode.c:604:12: branch_false: following ‘false’ branch (when ‘p’ is non-NULL)... Pillow-12.1.0/src/encode.c:607:9: branch_false: ...to here Pillow-12.1.0/src/encode.c:613:15: call_function: calling ‘PyImaging_EncoderNew’ from ‘PyImaging_ZipEncoderNew’ # 57| void *context; # 58| # 59|-> if (PyType_Ready(&ImagingEncoderType) < 0) { # 60| return NULL; # 61| } Error: GCC_ANALYZER_WARNING (CWE-401): [#def20] Pillow-12.1.0/src/encode.c:195:5: warning[-Wanalyzer-malloc-leak]: leak of ‘buf’ Pillow-12.1.0/src/encode.c:184:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/encode.c:190:20: branch_false: ...to here Pillow-12.1.0/src/encode.c:190:20: acquire_memory: allocated here Pillow-12.1.0/src/encode.c:191:8: branch_false: following ‘false’ branch (when ‘buf’ is non-NULL)... Pillow-12.1.0/src/encode.c:195:5: branch_false: ...to here Pillow-12.1.0/src/encode.c:195:5: throw: if ‘ImagingSectionEnter’ throws an exception... Pillow-12.1.0/src/encode.c:195:5: danger: ‘buf’ leaks here; was allocated at [(3)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/2) # 193| } # 194| # 195|-> ImagingSectionEnter(&cookie); # 196| # 197| do { Error: GCC_ANALYZER_WARNING (CWE-401): [#def21] Pillow-12.1.0/src/encode.c:201:18: warning[-Wanalyzer-malloc-leak]: leak of ‘buf’ Pillow-12.1.0/src/encode.c:184:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/encode.c:190:20: branch_false: ...to here Pillow-12.1.0/src/encode.c:190:20: acquire_memory: allocated here Pillow-12.1.0/src/encode.c:191:8: branch_false: following ‘false’ branch (when ‘buf’ is non-NULL)... Pillow-12.1.0/src/encode.c:195:5: branch_false: ...to here Pillow-12.1.0/src/encode.c:201:18: throw: if the called function throws an exception... Pillow-12.1.0/src/encode.c:201:18: danger: ‘buf’ leaks here; was allocated at [(3)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/2) # 199| function. */ # 200| # 201|-> status = encoder->encode(encoder->im, &encoder->state, buf, bufsize); # 202| # 203| if (status > 0) { Error: GCC_ANALYZER_WARNING (CWE-401): [#def22] Pillow-12.1.0/src/encode.c:1089:14: warning[-Wanalyzer-malloc-leak]: leak of ‘qarrays’ Pillow-12.1.0/src/encode.c:1055:1: enter_function: entry to ‘get_qtables_arrays’ Pillow-12.1.0/src/encode.c:1062:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/encode.c:1066:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/encode.c:1071:14: branch_false: ...to here Pillow-12.1.0/src/encode.c:1073:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/encode.c:1082:38: branch_false: ...to here Pillow-12.1.0/src/encode.c:1082:31: acquire_memory: allocated here Pillow-12.1.0/src/encode.c:1083:8: branch_false: following ‘false’ branch (when ‘qarrays’ is non-NULL)... Pillow-12.1.0/src/encode.c:1083:8: branch_false: ...to here Pillow-12.1.0/src/encode.c:1087:17: branch_true: following ‘true’ branch (when ‘i < num_tables’)... Pillow-12.1.0/src/encode.c:1088:17: call_function: inlined call to ‘_Py_TYPE’ from ‘get_qtables_arrays’ Pillow-12.1.0/src/encode.c:1088:17: branch_false: following ‘false’ branch... Pillow-12.1.0/src/encode.c:1088:17: call_function: inlined call to ‘PyType_HasFeature’ from ‘get_qtables_arrays’ Pillow-12.1.0/src/encode.c:1088:17: branch_true: following ‘true’ branch... Pillow-12.1.0/src/encode.c:1088:9: branch_true: ...to here Pillow-12.1.0/src/encode.c:1089:14: throw: if ‘PySequence_Check’ throws an exception... Pillow-12.1.0/src/encode.c:1089:14: danger: ‘qarrays’ leaks here; was allocated at [(8)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/7) # 1087| for (i = 0; i < num_tables; i++) { # 1088| table = PySequence_Fast_GET_ITEM(tables, i); # 1089|-> if (!PySequence_Check(table)) { # 1090| PyErr_SetString(PyExc_ValueError, "Invalid quantization tables"); # 1091| goto JPEG_QTABLES_ERR; Error: GCC_ANALYZER_WARNING (CWE-401): [#def23] Pillow-12.1.0/src/encode.c:1090:13: warning[-Wanalyzer-malloc-leak]: leak of ‘qarrays’ Pillow-12.1.0/src/encode.c:1055:1: enter_function: entry to ‘get_qtables_arrays’ Pillow-12.1.0/src/encode.c:1062:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/encode.c:1066:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/encode.c:1071:14: branch_false: ...to here Pillow-12.1.0/src/encode.c:1073:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/encode.c:1082:38: branch_false: ...to here Pillow-12.1.0/src/encode.c:1082:31: acquire_memory: allocated here Pillow-12.1.0/src/encode.c:1083:8: branch_false: following ‘false’ branch (when ‘qarrays’ is non-NULL)... Pillow-12.1.0/src/encode.c:1083:8: branch_false: ...to here Pillow-12.1.0/src/encode.c:1087:17: branch_true: following ‘true’ branch (when ‘i < num_tables’)... Pillow-12.1.0/src/encode.c:1088:17: call_function: inlined call to ‘_Py_TYPE’ from ‘get_qtables_arrays’ Pillow-12.1.0/src/encode.c:1088:17: branch_true: following ‘true’ branch... Pillow-12.1.0/src/encode.c:1088:9: branch_true: ...to here Pillow-12.1.0/src/encode.c:1089:12: branch_true: following ‘true’ branch... Pillow-12.1.0/src/encode.c:1090:13: branch_true: ...to here Pillow-12.1.0/src/encode.c:1090:13: throw: if ‘PyErr_SetString’ throws an exception... Pillow-12.1.0/src/encode.c:1090:13: danger: ‘qarrays’ leaks here; was allocated at [(8)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/7) # 1088| table = PySequence_Fast_GET_ITEM(tables, i); # 1089| if (!PySequence_Check(table)) { # 1090|-> PyErr_SetString(PyExc_ValueError, "Invalid quantization tables"); # 1091| goto JPEG_QTABLES_ERR; # 1092| } Error: GCC_ANALYZER_WARNING (CWE-401): [#def24] Pillow-12.1.0/src/encode.c:1093:13: warning[-Wanalyzer-malloc-leak]: leak of ‘qarrays’ Pillow-12.1.0/src/encode.c:1055:1: enter_function: entry to ‘get_qtables_arrays’ Pillow-12.1.0/src/encode.c:1062:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/encode.c:1066:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/encode.c:1071:14: branch_false: ...to here Pillow-12.1.0/src/encode.c:1073:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/encode.c:1082:38: branch_false: ...to here Pillow-12.1.0/src/encode.c:1082:31: acquire_memory: allocated here Pillow-12.1.0/src/encode.c:1083:8: branch_false: following ‘false’ branch (when ‘qarrays’ is non-NULL)... Pillow-12.1.0/src/encode.c:1083:8: branch_false: ...to here Pillow-12.1.0/src/encode.c:1087:17: branch_true: following ‘true’ branch (when ‘i < num_tables’)... Pillow-12.1.0/src/encode.c:1088:17: call_function: inlined call to ‘_Py_TYPE’ from ‘get_qtables_arrays’ Pillow-12.1.0/src/encode.c:1088:17: branch_false: following ‘false’ branch... Pillow-12.1.0/src/encode.c:1088:17: call_function: inlined call to ‘PyType_HasFeature’ from ‘get_qtables_arrays’ Pillow-12.1.0/src/encode.c:1088:17: branch_true: following ‘true’ branch... Pillow-12.1.0/src/encode.c:1088:9: branch_true: ...to here Pillow-12.1.0/src/encode.c:1089:12: branch_false: following ‘false’ branch... Pillow-12.1.0/src/encode.c:1093:13: branch_false: ...to here Pillow-12.1.0/src/encode.c:1093:13: throw: if ‘PySequence_Size’ throws an exception... Pillow-12.1.0/src/encode.c:1093:13: danger: ‘qarrays’ leaks here; was allocated at [(8)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/7) # 1091| goto JPEG_QTABLES_ERR; # 1092| } # 1093|-> if (PySequence_Size(table) != DCTSIZE2) { # 1094| PyErr_SetString(PyExc_ValueError, "Invalid quantization table size"); # 1095| goto JPEG_QTABLES_ERR; Error: GCC_ANALYZER_WARNING (CWE-401): [#def25] Pillow-12.1.0/src/encode.c:1094:13: warning[-Wanalyzer-malloc-leak]: leak of ‘qarrays’ Pillow-12.1.0/src/encode.c:1055:1: enter_function: entry to ‘get_qtables_arrays’ Pillow-12.1.0/src/encode.c:1062:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/encode.c:1066:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/encode.c:1071:14: branch_false: ...to here Pillow-12.1.0/src/encode.c:1073:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/encode.c:1082:38: branch_false: ...to here Pillow-12.1.0/src/encode.c:1082:31: acquire_memory: allocated here Pillow-12.1.0/src/encode.c:1083:8: branch_false: following ‘false’ branch (when ‘qarrays’ is non-NULL)... Pillow-12.1.0/src/encode.c:1083:8: branch_false: ...to here Pillow-12.1.0/src/encode.c:1087:17: branch_true: following ‘true’ branch (when ‘i < num_tables’)... Pillow-12.1.0/src/encode.c:1088:17: call_function: inlined call to ‘_Py_TYPE’ from ‘get_qtables_arrays’ Pillow-12.1.0/src/encode.c:1088:17: branch_true: following ‘true’ branch... Pillow-12.1.0/src/encode.c:1088:9: branch_true: ...to here Pillow-12.1.0/src/encode.c:1089:12: branch_false: following ‘false’ branch... Pillow-12.1.0/src/encode.c:1093:13: branch_false: ...to here Pillow-12.1.0/src/encode.c:1093:12: branch_true: following ‘true’ branch... Pillow-12.1.0/src/encode.c:1094:13: branch_true: ...to here Pillow-12.1.0/src/encode.c:1094:13: throw: if ‘PyErr_SetString’ throws an exception... Pillow-12.1.0/src/encode.c:1094:13: danger: ‘qarrays’ leaks here; was allocated at [(8)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/7) # 1092| } # 1093| if (PySequence_Size(table) != DCTSIZE2) { # 1094|-> PyErr_SetString(PyExc_ValueError, "Invalid quantization table size"); # 1095| goto JPEG_QTABLES_ERR; # 1096| } Error: GCC_ANALYZER_WARNING (CWE-401): [#def26] Pillow-12.1.0/src/encode.c:1097:22: warning[-Wanalyzer-malloc-leak]: leak of ‘qarrays’ Pillow-12.1.0/src/encode.c:1055:1: enter_function: entry to ‘get_qtables_arrays’ Pillow-12.1.0/src/encode.c:1062:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/encode.c:1066:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/encode.c:1071:14: branch_false: ...to here Pillow-12.1.0/src/encode.c:1073:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/encode.c:1082:38: branch_false: ...to here Pillow-12.1.0/src/encode.c:1082:31: acquire_memory: allocated here Pillow-12.1.0/src/encode.c:1083:8: branch_false: following ‘false’ branch (when ‘qarrays’ is non-NULL)... Pillow-12.1.0/src/encode.c:1083:8: branch_false: ...to here Pillow-12.1.0/src/encode.c:1087:17: branch_true: following ‘true’ branch (when ‘i < num_tables’)... Pillow-12.1.0/src/encode.c:1088:17: call_function: inlined call to ‘_Py_TYPE’ from ‘get_qtables_arrays’ Pillow-12.1.0/src/encode.c:1088:17: branch_false: following ‘false’ branch... Pillow-12.1.0/src/encode.c:1088:17: call_function: inlined call to ‘PyType_HasFeature’ from ‘get_qtables_arrays’ Pillow-12.1.0/src/encode.c:1088:17: branch_true: following ‘true’ branch... Pillow-12.1.0/src/encode.c:1088:9: branch_true: ...to here Pillow-12.1.0/src/encode.c:1089:12: branch_false: following ‘false’ branch... Pillow-12.1.0/src/encode.c:1093:13: branch_false: ...to here Pillow-12.1.0/src/encode.c:1093:12: branch_false: following ‘false’ branch... Pillow-12.1.0/src/encode.c:1097:22: branch_false: ...to here Pillow-12.1.0/src/encode.c:1097:22: throw: if ‘PySequence_Fast’ throws an exception... Pillow-12.1.0/src/encode.c:1097:22: danger: ‘qarrays’ leaks here; was allocated at [(8)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/7) # 1095| goto JPEG_QTABLES_ERR; # 1096| } # 1097|-> table_data = PySequence_Fast(table, "expected a sequence"); # 1098| for (j = 0; j < DCTSIZE2; j++) { # 1099| qarrays[i * DCTSIZE2 + j] = Error: GCC_ANALYZER_WARNING (CWE-401): [#def27] Pillow-12.1.0/src/encode.c:1100:17: warning[-Wanalyzer-malloc-leak]: leak of ‘qarrays’ Pillow-12.1.0/src/encode.c:1055:1: enter_function: entry to ‘get_qtables_arrays’ Pillow-12.1.0/src/encode.c:1062:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/encode.c:1066:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/encode.c:1071:14: branch_false: ...to here Pillow-12.1.0/src/encode.c:1073:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/encode.c:1082:38: branch_false: ...to here Pillow-12.1.0/src/encode.c:1082:31: acquire_memory: allocated here Pillow-12.1.0/src/encode.c:1083:8: branch_false: following ‘false’ branch (when ‘qarrays’ is non-NULL)... Pillow-12.1.0/src/encode.c:1083:8: branch_false: ...to here Pillow-12.1.0/src/encode.c:1087:17: branch_true: following ‘true’ branch (when ‘i < num_tables’)... Pillow-12.1.0/src/encode.c:1088:17: call_function: inlined call to ‘_Py_TYPE’ from ‘get_qtables_arrays’ Pillow-12.1.0/src/encode.c:1088:17: branch_true: following ‘true’ branch... Pillow-12.1.0/src/encode.c:1088:9: branch_true: ...to here Pillow-12.1.0/src/encode.c:1089:12: branch_false: following ‘false’ branch... Pillow-12.1.0/src/encode.c:1093:13: branch_false: ...to here Pillow-12.1.0/src/encode.c:1093:12: branch_false: following ‘false’ branch... Pillow-12.1.0/src/encode.c:1097:22: branch_false: ...to here Pillow-12.1.0/src/encode.c:1098:21: branch_true: following ‘true’ branch (when ‘j != 64’)... Pillow-12.1.0/src/encode.c:1100:17: call_function: inlined call to ‘_Py_TYPE’ from ‘get_qtables_arrays’ Pillow-12.1.0/src/encode.c:1100:17: branch_true: following ‘true’ branch... Pillow-12.1.0/src/encode.c:1100:17: branch_true: ...to here Pillow-12.1.0/src/encode.c:1100:17: throw: if ‘PyLong_AsLong’ throws an exception... Pillow-12.1.0/src/encode.c:1100:17: danger: ‘qarrays’ leaks here; was allocated at [(8)](sarif:/runs/0/results/9/codeFlows/0/threadFlows/0/locations/7) # 1098| for (j = 0; j < DCTSIZE2; j++) { # 1099| qarrays[i * DCTSIZE2 + j] = # 1100|-> PyLong_AS_LONG(PySequence_Fast_GET_ITEM(table_data, j)); # 1101| } # 1102| Py_DECREF(table_data); Error: GCC_ANALYZER_WARNING (CWE-401): [#def28] Pillow-12.1.0/src/encode.c:1109:9: warning[-Wanalyzer-malloc-leak]: leak of ‘qarrays’ Pillow-12.1.0/src/encode.c:1055:1: enter_function: entry to ‘get_qtables_arrays’ Pillow-12.1.0/src/encode.c:1062:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/encode.c:1066:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/encode.c:1071:14: branch_false: ...to here Pillow-12.1.0/src/encode.c:1073:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/encode.c:1082:38: branch_false: ...to here Pillow-12.1.0/src/encode.c:1082:31: acquire_memory: allocated here Pillow-12.1.0/src/encode.c:1083:8: branch_false: following ‘false’ branch (when ‘qarrays’ is non-NULL)... Pillow-12.1.0/src/encode.c:1083:8: branch_false: ...to here Pillow-12.1.0/src/encode.c:1087:17: branch_false: following ‘false’ branch (when ‘i >= num_tables’)... Pillow-12.1.0/src/encode.c:1105:5: branch_false: ...to here Pillow-12.1.0/src/encode.c:1108:5: call_function: inlined call to ‘Py_DECREF’ from ‘get_qtables_arrays’ Pillow-12.1.0/src/encode.c:1109:9: branch_true: ...to here Pillow-12.1.0/src/encode.c:1109:9: throw: if ‘PyErr_Occurred’ throws an exception... Pillow-12.1.0/src/encode.c:1109:9: danger: ‘qarrays’ leaks here; was allocated at [(8)](sarif:/runs/0/results/10/codeFlows/0/threadFlows/0/locations/7) # 1107| JPEG_QTABLES_ERR: # 1108| Py_DECREF(tables); // Run on both error and not error # 1109|-> if (PyErr_Occurred()) { # 1110| free(qarrays); # 1111| qarrays = NULL; Error: GCC_ANALYZER_WARNING (CWE-401): [#def29] Pillow-12.1.0/src/libImaging/Arrow.c:72:11: warning[-Wanalyzer-malloc-leak]: leak of ‘json’ Pillow-12.1.0/src/libImaging/Arrow.c:66:12: acquire_memory: allocated here Pillow-12.1.0/src/libImaging/Arrow.c:68:8: branch_false: following ‘false’ branch (when ‘json’ is non-NULL)... Pillow-12.1.0/src/libImaging/Arrow.c:79:9: branch_false: ...to here Pillow-12.1.0/src/libImaging/Arrow.c:72:11: throw: if ‘PyOS_snprintf’ throws an exception... Pillow-12.1.0/src/libImaging/Arrow.c:72:11: danger: ‘json’ leaks here; was allocated at [(1)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/0) # 70| } # 71| # 72|-> err = PyOS_snprintf( # 73| json, # 74| len, Error: GCC_ANALYZER_WARNING (CWE-401): [#def30] Pillow-12.1.0/src/libImaging/Arrow.c:101:11: warning[-Wanalyzer-malloc-leak]: leak of ‘json’ Pillow-12.1.0/src/libImaging/Arrow.c:95:12: acquire_memory: allocated here Pillow-12.1.0/src/libImaging/Arrow.c:97:8: branch_false: following ‘false’ branch (when ‘json’ is non-NULL)... Pillow-12.1.0/src/libImaging/Arrow.c:101:44: branch_false: ...to here Pillow-12.1.0/src/libImaging/Arrow.c:101:11: throw: if ‘PyOS_snprintf’ throws an exception... Pillow-12.1.0/src/libImaging/Arrow.c:101:11: danger: ‘json’ leaks here; was allocated at [(1)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/0) # 99| } # 100| # 101|-> err = PyOS_snprintf(json, len, format, im->band_names[0]); # 102| if (err < 0) { # 103| return NULL; Error: COMPILER_WARNING: [#def31] Pillow-12.1.0/src/libImaging/Arrow.c: scope_hint: In function ‘export_named_type’ Pillow-12.1.0/src/libImaging/Arrow.c:170:5: warning[-Wstringop-truncation]: ‘__strncpy_chk’ specified bound depends on the length of the source argument # 170 | strncpy(formatp, format, format_len); # | ^ Pillow-12.1.0/src/libImaging/Arrow.c:155:25: note: length computed here # 155 | size_t format_len = strlen(format) + 1; # | ^~~~~~~~~~~~~~ # 168| } # 169| # 170|-> strncpy(formatp, format, format_len); # 171| strncpy(namep, name, name_len); # 172| Error: COMPILER_WARNING: [#def32] Pillow-12.1.0/src/libImaging/Arrow.c:171:5: warning[-Wstringop-truncation]: ‘__strncpy_chk’ specified bound depends on the length of the source argument # 171 | strncpy(namep, name, name_len); # | ^ Pillow-12.1.0/src/libImaging/Arrow.c:156:23: note: length computed here # 156 | size_t name_len = strlen(name) + 1; # | ^~~~~~~~~~~~ # 169| # 170| strncpy(formatp, format, format_len); # 171|-> strncpy(namep, name, name_len); # 172| # 173| *schema = (struct ArrowSchema){// Type description Error: GCC_ANALYZER_WARNING (CWE-476): [#def33] Pillow-12.1.0/src/libImaging/Arrow.c:222:5: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘*schema.children’ Pillow-12.1.0/src/libImaging/Arrow.c:188:1: enter_function: entry to ‘export_imaging_schema’ Pillow-12.1.0/src/libImaging/Arrow.c:192:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Arrow.c:197:9: branch_false: ...to here Pillow-12.1.0/src/libImaging/Arrow.c:197:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Arrow.c:201:9: branch_false: ...to here Pillow-12.1.0/src/libImaging/Arrow.c:201:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Arrow.c:215:14: branch_false: ...to here Pillow-12.1.0/src/libImaging/Arrow.c:215:14: call_function: calling ‘export_named_type’ from ‘export_imaging_schema’ Pillow-12.1.0/src/libImaging/Arrow.c:215:14: return_function: returning to ‘export_imaging_schema’ from ‘export_named_type’ Pillow-12.1.0/src/libImaging/Arrow.c:216:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Arrow.c:220:5: branch_false: ...to here Pillow-12.1.0/src/libImaging/Arrow.c:221:24: acquire_memory: this call could return NULL Pillow-12.1.0/src/libImaging/Arrow.c:222:5: danger: ‘calloc(1, 8)’ could be NULL: unchecked value from [(19)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/18) # 220| schema->n_children = 1; # 221| schema->children = calloc(1, sizeof(struct ArrowSchema *)); # 222|-> schema->children[0] = (struct ArrowSchema *)calloc(1, sizeof(struct ArrowSchema)); # 223| retval = export_named_type( # 224| schema->children[0], im->arrow_band_format, getModeData(im->mode)->name Error: GCC_ANALYZER_WARNING (CWE-476): [#def34] Pillow-12.1.0/src/libImaging/Arrow.c:306:5: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘*array.buffers’ Pillow-12.1.0/src/libImaging/Arrow.c:278:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Arrow.c:282:9: branch_false: ...to here Pillow-12.1.0/src/libImaging/Arrow.c:304:37: acquire_memory: this call could return NULL Pillow-12.1.0/src/libImaging/Arrow.c:306:5: danger: ‘malloc(16)’ could be NULL: unchecked value from [(3)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/2) # 304| array->buffers = (const void **)malloc(sizeof(void *) * array->n_buffers); # 305| // assert(array->buffers != NULL); # 306|-> array->buffers[0] = NULL; // no nulls, null bitmap can be omitted # 307| # 308| if (im->block) { Error: GCC_ANALYZER_WARNING (CWE-476): [#def35] Pillow-12.1.0/src/libImaging/Arrow.c:387:9: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘calloc(2, 8)’ Pillow-12.1.0/src/libImaging/Arrow.c:321:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Arrow.c:325:9: branch_false: ...to here Pillow-12.1.0/src/libImaging/Arrow.c:350:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Arrow.c:354:5: branch_false: ...to here Pillow-12.1.0/src/libImaging/Arrow.c:359:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Arrow.c:362:47: branch_false: ...to here Pillow-12.1.0/src/libImaging/Arrow.c:363:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Arrow.c:368:5: branch_false: ...to here Pillow-12.1.0/src/libImaging/Arrow.c:384:24: acquire_memory: this call could return NULL Pillow-12.1.0/src/libImaging/Arrow.c:386:8: branch_true: following ‘true’ branch... Pillow-12.1.0/src/libImaging/Arrow.c:387:9: branch_true: ...to here Pillow-12.1.0/src/libImaging/Arrow.c:387:9: danger: ‘calloc(2, 8)’ could be NULL: unchecked value from [(9)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/8) # 385| # 386| if (im->block) { # 387|-> array->children[0]->buffers[1] = im->block; # 388| } else { # 389| array->children[0]->buffers[1] = im->blocks[0].ptr; Error: GCC_ANALYZER_WARNING (CWE-476): [#def36] Pillow-12.1.0/src/libImaging/Arrow.c:389:9: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘calloc(2, 8)’ Pillow-12.1.0/src/libImaging/Arrow.c:321:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Arrow.c:325:9: branch_false: ...to here Pillow-12.1.0/src/libImaging/Arrow.c:350:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Arrow.c:354:5: branch_false: ...to here Pillow-12.1.0/src/libImaging/Arrow.c:359:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Arrow.c:362:47: branch_false: ...to here Pillow-12.1.0/src/libImaging/Arrow.c:363:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Arrow.c:368:5: branch_false: ...to here Pillow-12.1.0/src/libImaging/Arrow.c:384:24: acquire_memory: this call could return NULL Pillow-12.1.0/src/libImaging/Arrow.c:386:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Arrow.c:389:42: branch_false: ...to here Pillow-12.1.0/src/libImaging/Arrow.c:389:9: danger: ‘calloc(2, 8)’ could be NULL: unchecked value from [(9)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/8) # 387| array->children[0]->buffers[1] = im->block; # 388| } else { # 389|-> array->children[0]->buffers[1] = im->blocks[0].ptr; # 390| } # 391| return 0; Error: GCC_ANALYZER_WARNING (CWE-476): [#def37] Pillow-12.1.0/src/libImaging/Arrow.c:394:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘*array.children’ Pillow-12.1.0/src/libImaging/Arrow.c:321:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Arrow.c:325:9: branch_false: ...to here Pillow-12.1.0/src/libImaging/Arrow.c:350:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Arrow.c:354:5: branch_false: ...to here Pillow-12.1.0/src/libImaging/Arrow.c:358:23: acquire_memory: allocated here Pillow-12.1.0/src/libImaging/Arrow.c:359:8: release_memory: assuming ‘*array.children’ is NULL Pillow-12.1.0/src/libImaging/Arrow.c:359:8: branch_true: following ‘true’ branch... Pillow-12.1.0/src/libImaging/Arrow.c:360:9: branch_true: ...to here Pillow-12.1.0/src/libImaging/Arrow.c:394:9: danger: dereference of NULL ‘*array.children’ # 392| # 393| err: # 394|-> if (array->children[0]) { # 395| free(array->children[0]); # 396| } Error: GCC_ANALYZER_WARNING (CWE-476): [#def38] Pillow-12.1.0/src/libImaging/Arrow.c:394:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’ Pillow-12.1.0/src/libImaging/Arrow.c:321:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Arrow.c:325:9: branch_false: ...to here Pillow-12.1.0/src/libImaging/Arrow.c:350:8: branch_true: following ‘true’ branch... Pillow-12.1.0/src/libImaging/Arrow.c:351:9: branch_true: ...to here Pillow-12.1.0/src/libImaging/Arrow.c:394:9: release_memory: using NULL here Pillow-12.1.0/src/libImaging/Arrow.c:394:9: danger: dereference of NULL ‘*array.children’ # 392| # 393| err: # 394|-> if (array->children[0]) { # 395| free(array->children[0]); # 396| } Error: GCC_ANALYZER_WARNING (CWE-401): [#def39] Pillow-12.1.0/src/libImaging/BoxBlur.c:191:5: warning[-Wanalyzer-malloc-leak]: leak of ‘lineOut’ Pillow-12.1.0/src/libImaging/BoxBlur.c:323:1: enter_function: entry to ‘ImagingGaussianBlur’ Pillow-12.1.0/src/libImaging/BoxBlur.c:326:12: call_function: calling ‘ImagingBoxBlur’ from ‘ImagingGaussianBlur’ # 189| // printf(">>> %d %d %d\n", radius, ww, fw); # 190| # 191|-> ImagingSectionEnter(&cookie); # 192| # 193| if (imIn->image8) { Error: GCC_ANALYZER_WARNING (CWE-401): [#def40] Pillow-12.1.0/src/libImaging/Convert.c:1247:13: warning[-Wanalyzer-malloc-leak]: leak of ‘errors’ Pillow-12.1.0/src/libImaging/Convert.c:1200:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Convert.c:1207:5: branch_false: ...to here Pillow-12.1.0/src/libImaging/Convert.c:1210:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Convert.c:1228:13: branch_false: ...to here Pillow-12.1.0/src/libImaging/Convert.c:1228:12: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Convert.c:1236:12: branch_false: ...to here Pillow-12.1.0/src/libImaging/Convert.c:1236:12: branch_true: following ‘true’ branch (when ‘dither != 0’)... Pillow-12.1.0/src/libImaging/Convert.c:1240:29: branch_true: ...to here Pillow-12.1.0/src/libImaging/Convert.c:1240:22: acquire_memory: allocated here Pillow-12.1.0/src/libImaging/Convert.c:1241:16: branch_false: following ‘false’ branch (when ‘errors’ is non-NULL)... Pillow-12.1.0/src/libImaging/Convert.c:1247:13: branch_false: ...to here Pillow-12.1.0/src/libImaging/Convert.c:1247:13: throw: if ‘ImagingSectionEnter’ throws an exception... Pillow-12.1.0/src/libImaging/Convert.c:1247:13: danger: ‘errors’ leaks here; was allocated at [(9)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/8) # 1245| # 1246| /* Map each pixel to the nearest palette entry */ # 1247|-> ImagingSectionEnter(&cookie); # 1248| for (y = 0; y < imIn->ysize; y++) { # 1249| int r, r0, r1, r2; Error: GCC_ANALYZER_WARNING (CWE-401): [#def41] Pillow-12.1.0/src/libImaging/Convert.c:1271:25: warning[-Wanalyzer-malloc-leak]: leak of ‘errors’ Pillow-12.1.0/src/libImaging/Convert.c:1200:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Convert.c:1207:5: branch_false: ...to here Pillow-12.1.0/src/libImaging/Convert.c:1210:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Convert.c:1228:13: branch_false: ...to here Pillow-12.1.0/src/libImaging/Convert.c:1228:12: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Convert.c:1236:12: branch_false: ...to here Pillow-12.1.0/src/libImaging/Convert.c:1236:12: branch_true: following ‘true’ branch (when ‘dither != 0’)... Pillow-12.1.0/src/libImaging/Convert.c:1240:29: branch_true: ...to here Pillow-12.1.0/src/libImaging/Convert.c:1240:22: acquire_memory: allocated here Pillow-12.1.0/src/libImaging/Convert.c:1241:16: branch_false: following ‘false’ branch (when ‘errors’ is non-NULL)... Pillow-12.1.0/src/libImaging/Convert.c:1247:13: branch_false: ...to here Pillow-12.1.0/src/libImaging/Convert.c:1248:25: branch_true: following ‘true’ branch... Pillow-12.1.0/src/libImaging/Convert.c:1252:38: branch_true: ...to here Pillow-12.1.0/src/libImaging/Convert.c:1260:29: branch_true: following ‘true’ branch... Pillow-12.1.0/src/libImaging/Convert.c:1264:25: branch_true: ...to here Pillow-12.1.0/src/libImaging/Convert.c:1273:24: branch_true: following ‘true’ branch (when ‘mode == 11’)... Pillow-12.1.0/src/libImaging/Convert.c:1274:79: branch_true: ...to here Pillow-12.1.0/src/libImaging/Convert.c:1260:29: branch_true: following ‘true’ branch... Pillow-12.1.0/src/libImaging/Convert.c:1264:25: branch_true: ...to here Pillow-12.1.0/src/libImaging/Convert.c:1270:24: branch_true: following ‘true’ branch... Pillow-12.1.0/src/libImaging/Convert.c:1271:25: branch_true: ...to here Pillow-12.1.0/src/libImaging/Convert.c:1271:25: throw: if ‘ImagingPaletteCacheUpdate’ throws an exception... Pillow-12.1.0/src/libImaging/Convert.c:1271:25: danger: ‘errors’ leaks here; was allocated at [(9)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/8) # 1269| cache = &ImagingPaletteCache(palette, r, g, b); # 1270| if (cache[0] == 0x100) { # 1271|-> ImagingPaletteCacheUpdate(palette, r, g, b); # 1272| } # 1273| if (alpha) { Error: GCC_ANALYZER_WARNING (CWE-401): [#def42] Pillow-12.1.0/src/libImaging/Convert.c:1271:25: warning[-Wanalyzer-malloc-leak]: leak of ‘e’ Pillow-12.1.0/src/libImaging/Convert.c:1200:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Convert.c:1207:5: branch_false: ...to here Pillow-12.1.0/src/libImaging/Convert.c:1210:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Convert.c:1228:13: branch_false: ...to here Pillow-12.1.0/src/libImaging/Convert.c:1228:12: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Convert.c:1236:12: branch_false: ...to here Pillow-12.1.0/src/libImaging/Convert.c:1236:12: branch_true: following ‘true’ branch (when ‘dither != 0’)... Pillow-12.1.0/src/libImaging/Convert.c:1240:29: branch_true: ...to here Pillow-12.1.0/src/libImaging/Convert.c:1240:22: acquire_memory: allocated here Pillow-12.1.0/src/libImaging/Convert.c:1241:16: branch_false: following ‘false’ branch (when ‘errors’ is non-NULL)... Pillow-12.1.0/src/libImaging/Convert.c:1247:13: branch_false: ...to here Pillow-12.1.0/src/libImaging/Convert.c:1248:25: branch_true: following ‘true’ branch... Pillow-12.1.0/src/libImaging/Convert.c:1252:38: branch_true: ...to here Pillow-12.1.0/src/libImaging/Convert.c:1260:29: branch_true: following ‘true’ branch... Pillow-12.1.0/src/libImaging/Convert.c:1264:25: branch_true: ...to here Pillow-12.1.0/src/libImaging/Convert.c:1270:24: branch_true: following ‘true’ branch... Pillow-12.1.0/src/libImaging/Convert.c:1271:25: branch_true: ...to here Pillow-12.1.0/src/libImaging/Convert.c:1271:25: throw: if ‘ImagingPaletteCacheUpdate’ throws an exception... Pillow-12.1.0/src/libImaging/Convert.c:1271:25: danger: ‘e’ leaks here; was allocated at [(9)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/8) # 1269| cache = &ImagingPaletteCache(palette, r, g, b); # 1270| if (cache[0] == 0x100) { # 1271|-> ImagingPaletteCacheUpdate(palette, r, g, b); # 1272| } # 1273| if (alpha) { Error: GCC_ANALYZER_WARNING (CWE-401): [#def43] Pillow-12.1.0/src/libImaging/Convert.c:1317:13: warning[-Wanalyzer-malloc-leak]: leak of ‘errors’ Pillow-12.1.0/src/libImaging/Convert.c:1200:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Convert.c:1207:5: branch_false: ...to here Pillow-12.1.0/src/libImaging/Convert.c:1210:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Convert.c:1228:13: branch_false: ...to here Pillow-12.1.0/src/libImaging/Convert.c:1228:12: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Convert.c:1236:12: branch_false: ...to here Pillow-12.1.0/src/libImaging/Convert.c:1236:12: branch_true: following ‘true’ branch (when ‘dither != 0’)... Pillow-12.1.0/src/libImaging/Convert.c:1240:29: branch_true: ...to here Pillow-12.1.0/src/libImaging/Convert.c:1240:22: acquire_memory: allocated here Pillow-12.1.0/src/libImaging/Convert.c:1241:16: branch_false: following ‘false’ branch (when ‘errors’ is non-NULL)... Pillow-12.1.0/src/libImaging/Convert.c:1247:13: branch_false: ...to here Pillow-12.1.0/src/libImaging/Convert.c:1248:25: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Convert.c:1317:13: branch_false: ...to here Pillow-12.1.0/src/libImaging/Convert.c:1317:13: throw: if ‘ImagingSectionLeave’ throws an exception... Pillow-12.1.0/src/libImaging/Convert.c:1317:13: danger: ‘errors’ leaks here; was allocated at [(9)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/8) # 1315| e[2] = b2; # 1316| } # 1317|-> ImagingSectionLeave(&cookie); # 1318| free(errors); # 1319| Error: GCC_ANALYZER_WARNING (CWE-401): [#def44] Pillow-12.1.0/src/libImaging/Convert.c:1317:13: warning[-Wanalyzer-malloc-leak]: leak of ‘e’ Pillow-12.1.0/src/libImaging/Convert.c:1200:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Convert.c:1207:5: branch_false: ...to here Pillow-12.1.0/src/libImaging/Convert.c:1210:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Convert.c:1228:13: branch_false: ...to here Pillow-12.1.0/src/libImaging/Convert.c:1228:12: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Convert.c:1236:12: branch_false: ...to here Pillow-12.1.0/src/libImaging/Convert.c:1236:12: branch_true: following ‘true’ branch (when ‘dither != 0’)... Pillow-12.1.0/src/libImaging/Convert.c:1240:29: branch_true: ...to here Pillow-12.1.0/src/libImaging/Convert.c:1240:22: acquire_memory: allocated here Pillow-12.1.0/src/libImaging/Convert.c:1241:16: branch_false: following ‘false’ branch (when ‘errors’ is non-NULL)... Pillow-12.1.0/src/libImaging/Convert.c:1247:13: branch_false: ...to here Pillow-12.1.0/src/libImaging/Convert.c:1248:25: branch_true: following ‘true’ branch... Pillow-12.1.0/src/libImaging/Convert.c:1252:38: branch_true: ...to here Pillow-12.1.0/src/libImaging/Convert.c:1260:29: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Convert.c:1313:17: branch_false: ...to here Pillow-12.1.0/src/libImaging/Convert.c:1317:13: throw: if ‘ImagingSectionLeave’ throws an exception... Pillow-12.1.0/src/libImaging/Convert.c:1317:13: danger: ‘e’ leaks here; was allocated at [(9)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/8) # 1315| e[2] = b2; # 1316| } # 1317|-> ImagingSectionLeave(&cookie); # 1318| free(errors); # 1319| Error: GCC_ANALYZER_WARNING (CWE-401): [#def45] Pillow-12.1.0/src/libImaging/Convert.c:1386:9: warning[-Wanalyzer-malloc-leak]: leak of ‘errors’ Pillow-12.1.0/src/libImaging/Convert.c:1369:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Convert.c:1373:13: branch_false: ...to here Pillow-12.1.0/src/libImaging/Convert.c:1374:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Convert.c:1378:21: branch_false: ...to here Pillow-12.1.0/src/libImaging/Convert.c:1378:14: acquire_memory: allocated here Pillow-12.1.0/src/libImaging/Convert.c:1379:8: branch_false: following ‘false’ branch (when ‘errors’ is non-NULL)... Pillow-12.1.0/src/libImaging/Convert.c:1384:9: branch_false: ...to here Pillow-12.1.0/src/libImaging/Convert.c:1384:8: branch_true: following ‘true’ branch... Pillow-12.1.0/src/libImaging/Convert.c:1386:9: branch_true: ...to here Pillow-12.1.0/src/libImaging/Convert.c:1386:9: throw: if ‘ImagingSectionEnter’ throws an exception... Pillow-12.1.0/src/libImaging/Convert.c:1386:9: danger: ‘errors’ leaks here; was allocated at [(5)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/4) # 1384| if (imIn->bands == 1) { # 1385| /* map each pixel to black or white, using error diffusion */ # 1386|-> ImagingSectionEnter(&cookie); # 1387| for (y = 0; y < imIn->ysize; y++) { # 1388| int l, l0, l1, l2, d2; Error: GCC_ANALYZER_WARNING (CWE-401): [#def46] Pillow-12.1.0/src/libImaging/Convert.c:1413:9: warning[-Wanalyzer-malloc-leak]: leak of ‘errors’ Pillow-12.1.0/src/libImaging/Convert.c:1369:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Convert.c:1373:13: branch_false: ...to here Pillow-12.1.0/src/libImaging/Convert.c:1374:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Convert.c:1378:21: branch_false: ...to here Pillow-12.1.0/src/libImaging/Convert.c:1378:14: acquire_memory: allocated here Pillow-12.1.0/src/libImaging/Convert.c:1379:8: branch_false: following ‘false’ branch (when ‘errors’ is non-NULL)... Pillow-12.1.0/src/libImaging/Convert.c:1384:9: branch_false: ...to here Pillow-12.1.0/src/libImaging/Convert.c:1384:8: branch_true: following ‘true’ branch... Pillow-12.1.0/src/libImaging/Convert.c:1386:9: branch_true: ...to here Pillow-12.1.0/src/libImaging/Convert.c:1387:21: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Convert.c:1413:9: branch_false: ...to here Pillow-12.1.0/src/libImaging/Convert.c:1413:9: throw: if ‘ImagingSectionLeave’ throws an exception... Pillow-12.1.0/src/libImaging/Convert.c:1413:9: danger: ‘errors’ leaks here; was allocated at [(5)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/4) # 1411| errors[x] = l0; # 1412| } # 1413|-> ImagingSectionLeave(&cookie); # 1414| # 1415| } else { Error: GCC_ANALYZER_WARNING (CWE-401): [#def47] Pillow-12.1.0/src/libImaging/Convert.c:1417:9: warning[-Wanalyzer-malloc-leak]: leak of ‘errors’ Pillow-12.1.0/src/libImaging/Convert.c:1369:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Convert.c:1373:13: branch_false: ...to here Pillow-12.1.0/src/libImaging/Convert.c:1374:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Convert.c:1378:21: branch_false: ...to here Pillow-12.1.0/src/libImaging/Convert.c:1378:14: acquire_memory: allocated here Pillow-12.1.0/src/libImaging/Convert.c:1379:8: branch_false: following ‘false’ branch (when ‘errors’ is non-NULL)... Pillow-12.1.0/src/libImaging/Convert.c:1384:9: branch_false: ...to here Pillow-12.1.0/src/libImaging/Convert.c:1384:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Convert.c:1417:9: branch_false: ...to here Pillow-12.1.0/src/libImaging/Convert.c:1417:9: throw: if ‘ImagingSectionEnter’ throws an exception... Pillow-12.1.0/src/libImaging/Convert.c:1417:9: danger: ‘errors’ leaks here; was allocated at [(5)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/4) # 1415| } else { # 1416| /* map each pixel to black or white, using error diffusion */ # 1417|-> ImagingSectionEnter(&cookie); # 1418| for (y = 0; y < imIn->ysize; y++) { # 1419| int l, l0, l1, l2, d2; Error: GCC_ANALYZER_WARNING (CWE-401): [#def48] Pillow-12.1.0/src/libImaging/Convert.c:1444:9: warning[-Wanalyzer-malloc-leak]: leak of ‘errors’ Pillow-12.1.0/src/libImaging/Convert.c:1369:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Convert.c:1373:13: branch_false: ...to here Pillow-12.1.0/src/libImaging/Convert.c:1374:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Convert.c:1378:21: branch_false: ...to here Pillow-12.1.0/src/libImaging/Convert.c:1378:14: acquire_memory: allocated here Pillow-12.1.0/src/libImaging/Convert.c:1379:8: branch_false: following ‘false’ branch (when ‘errors’ is non-NULL)... Pillow-12.1.0/src/libImaging/Convert.c:1384:9: branch_false: ...to here Pillow-12.1.0/src/libImaging/Convert.c:1384:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Convert.c:1417:9: branch_false: ...to here Pillow-12.1.0/src/libImaging/Convert.c:1418:21: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Convert.c:1444:9: branch_false: ...to here Pillow-12.1.0/src/libImaging/Convert.c:1444:9: throw: if ‘ImagingSectionLeave’ throws an exception... Pillow-12.1.0/src/libImaging/Convert.c:1444:9: danger: ‘errors’ leaks here; was allocated at [(5)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/4) # 1442| errors[x] = l0; # 1443| } # 1444|-> ImagingSectionLeave(&cookie); # 1445| } # 1446| Error: GCC_ANALYZER_WARNING (CWE-401): [#def49] Pillow-12.1.0/src/libImaging/Draw.c:509:17: warning[-Wanalyzer-malloc-leak]: leak of ‘edge_table’ Pillow-12.1.0/src/libImaging/Draw.c:2024:1: enter_function: entry to ‘ImagingDrawOutline’ Pillow-12.1.0/src/libImaging/Draw.c:2030:5: branch_true: following ‘true’ branch... Pillow-12.1.0/src/libImaging/Draw.c:2032:5: call_function: calling ‘polygon_generic’ from ‘ImagingDrawOutline’ # 507| if (e[i].ymin == e[i].ymax) { # 508| if (hasAlpha != 1) { # 509|-> (*hline)(im, e[i].xmin, e[i].ymin, e[i].xmax, ink, mask); # 510| } # 511| continue; Error: GCC_ANALYZER_WARNING (CWE-401): [#def50] Pillow-12.1.0/src/libImaging/Draw.c:588:9: warning[-Wanalyzer-malloc-leak]: leak of ‘edge_table’ Pillow-12.1.0/src/libImaging/Draw.c:2024:1: enter_function: entry to ‘ImagingDrawOutline’ Pillow-12.1.0/src/libImaging/Draw.c:2030:5: branch_true: following ‘true’ branch... Pillow-12.1.0/src/libImaging/Draw.c:2032:5: call_function: calling ‘polygon_generic’ from ‘ImagingDrawOutline’ # 586| } # 587| } # 588|-> qsort(xx, j, sizeof(float), x_cmp); # 589| if (hasAlpha == 1) { # 590| int x_pos = j == 0 ? -1 : 0; Error: GCC_ANALYZER_WARNING (CWE-401): [#def51] Pillow-12.1.0/src/libImaging/Draw.c:588:9: warning[-Wanalyzer-malloc-leak]: leak of ‘xx’ Pillow-12.1.0/src/libImaging/Draw.c:2024:1: enter_function: entry to ‘ImagingDrawOutline’ Pillow-12.1.0/src/libImaging/Draw.c:2030:5: branch_true: following ‘true’ branch... Pillow-12.1.0/src/libImaging/Draw.c:2032:5: call_function: calling ‘polygon_generic’ from ‘ImagingDrawOutline’ # 586| } # 587| } # 588|-> qsort(xx, j, sizeof(float), x_cmp); # 589| if (hasAlpha == 1) { # 590| int x_pos = j == 0 ? -1 : 0; Error: GCC_ANALYZER_WARNING (CWE-416): [#def52] Pillow-12.1.0/src/libImaging/Draw.c:1984:9: warning[-Wanalyzer-use-after-free]: use after ‘free’ of ‘eIn’ Pillow-12.1.0/src/libImaging/Draw.c:1960:1: enter_function: entry to ‘ImagingOutlineTransform’ Pillow-12.1.0/src/libImaging/Draw.c:1977:12: call_function: calling ‘allocate’ from ‘ImagingOutlineTransform’ Pillow-12.1.0/src/libImaging/Draw.c:1977:12: return_function: returning to ‘ImagingOutlineTransform’ from ‘allocate’ Pillow-12.1.0/src/libImaging/Draw.c:1978:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Draw.c:1978:8: branch_false: ...to here Pillow-12.1.0/src/libImaging/Draw.c:1983:17: branch_true: following ‘true’ branch (when ‘i < n’)... Pillow-12.1.0/src/libImaging/Draw.c:1984:9: branch_true: ...to here Pillow-12.1.0/src/libImaging/Draw.c:1984:9: danger: use after ‘free’ of ‘eIn’; freed at [(10)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/9) # 1982| # 1983| for (i = 0; i < n; i++) { # 1984|-> x0 = eIn->x0; # 1985| y0 = eIn->y0; # 1986| Error: GCC_ANALYZER_WARNING (CWE-401): [#def53] Pillow-12.1.0/src/libImaging/Geometry.c:906:5: warning[-Wanalyzer-malloc-leak]: leak of ‘xintab’ Pillow-12.1.0/src/libImaging/Geometry.c:844:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Geometry.c:864:21: acquire_memory: allocated here Pillow-12.1.0/src/libImaging/Geometry.c:865:8: branch_false: following ‘false’ branch (when ‘xintab’ is non-NULL)... Pillow-12.1.0/src/libImaging/Geometry.c:870:10: branch_false: ...to here Pillow-12.1.0/src/libImaging/Geometry.c:906:5: throw: if ‘ImagingSectionEnter’ throws an exception... Pillow-12.1.0/src/libImaging/Geometry.c:906:5: danger: ‘xintab’ leaks here; was allocated at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2) # 904| } # 905| # 906|-> ImagingSectionEnter(&cookie); # 907| # 908| if (imIn->image8) { Error: GCC_ANALYZER_WARNING (CWE-401): [#def54] Pillow-12.1.0/src/libImaging/Geometry.c:914:5: warning[-Wanalyzer-malloc-leak]: leak of ‘xintab’ Pillow-12.1.0/src/libImaging/Geometry.c:844:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Geometry.c:864:21: acquire_memory: allocated here Pillow-12.1.0/src/libImaging/Geometry.c:865:8: branch_false: following ‘false’ branch (when ‘xintab’ is non-NULL)... Pillow-12.1.0/src/libImaging/Geometry.c:870:10: branch_false: ...to here Pillow-12.1.0/src/libImaging/Geometry.c:908:8: branch_true: following ‘true’ branch... Pillow-12.1.0/src/libImaging/Geometry.c:908:8: branch_true: ...to here Pillow-12.1.0/src/libImaging/Geometry.c:914:5: throw: if ‘ImagingSectionLeave’ throws an exception... Pillow-12.1.0/src/libImaging/Geometry.c:914:5: danger: ‘xintab’ leaks here; was allocated at [(3)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/2) # 912| } # 913| # 914|-> ImagingSectionLeave(&cookie); # 915| # 916| #undef AFFINE_SCALE Error: GCC_ANALYZER_WARNING (CWE-401): [#def55] Pillow-12.1.0/src/libImaging/Histo.c:47:15: warning[-Wanalyzer-malloc-leak]: leak of ‘ImagingHistogramNew(im)’ Pillow-12.1.0/src/libImaging/Histo.c:60:1: enter_function: entry to ‘ImagingGetHistogram’ Pillow-12.1.0/src/libImaging/Histo.c:67:8: branch_false: following ‘false’ branch (when ‘im’ is non-NULL)... Pillow-12.1.0/src/libImaging/Histo.c:71:8: branch_false: ...to here Pillow-12.1.0/src/libImaging/Histo.c:81:9: call_function: calling ‘ImagingHistogramNew’ from ‘ImagingGetHistogram’ Pillow-12.1.0/src/libImaging/Histo.c:81:9: return_function: returning to ‘ImagingGetHistogram’ from ‘ImagingHistogramNew’ Pillow-12.1.0/src/libImaging/Histo.c:82:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Histo.c:86:8: branch_false: ...to here Pillow-12.1.0/src/libImaging/Histo.c:86:8: branch_false: following ‘false’ branch (when ‘imMask’ is NULL)... Pillow-12.1.0/src/libImaging/Histo.c:121:13: branch_false: ...to here Pillow-12.1.0/src/libImaging/Histo.c:121:12: branch_true: following ‘true’ branch... Pillow-12.1.0/src/libImaging/Histo.c:122:13: branch_true: ...to here Pillow-12.1.0/src/libImaging/Histo.c:122:13: throw: if ‘ImagingSectionEnter’ throws an exception... Pillow-12.1.0/src/libImaging/Histo.c:47:15: danger: ‘ImagingHistogramNew(im)’ leaks here; was allocated at [(6)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/5) # 45| } # 46| # 47|-> h->mode = im->mode; # 48| h->bands = im->bands; # 49| Error: GCC_ANALYZER_WARNING (CWE-401): [#def56] Pillow-12.1.0/src/libImaging/Histo.c:89:13: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’ Pillow-12.1.0/src/libImaging/Histo.c:60:1: enter_function: entry to ‘ImagingGetHistogram’ Pillow-12.1.0/src/libImaging/Histo.c:67:8: branch_false: following ‘false’ branch (when ‘im’ is non-NULL)... Pillow-12.1.0/src/libImaging/Histo.c:71:8: branch_false: ...to here Pillow-12.1.0/src/libImaging/Histo.c:73:12: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Histo.c:76:12: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Histo.c:81:9: branch_false: ...to here Pillow-12.1.0/src/libImaging/Histo.c:81:9: call_function: calling ‘ImagingHistogramNew’ from ‘ImagingGetHistogram’ Pillow-12.1.0/src/libImaging/Histo.c:81:9: return_function: returning to ‘ImagingGetHistogram’ from ‘ImagingHistogramNew’ Pillow-12.1.0/src/libImaging/Histo.c:82:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Histo.c:86:8: branch_false: ...to here Pillow-12.1.0/src/libImaging/Histo.c:86:8: branch_true: following ‘true’ branch (when ‘imMask’ is non-NULL)... Pillow-12.1.0/src/libImaging/Histo.c:88:13: branch_true: ...to here Pillow-12.1.0/src/libImaging/Histo.c:88:12: branch_true: following ‘true’ branch... Pillow-12.1.0/src/libImaging/Histo.c:89:13: branch_true: ...to here Pillow-12.1.0/src/libImaging/Histo.c:89:13: throw: if ‘ImagingSectionEnter’ throws an exception... Pillow-12.1.0/src/libImaging/Histo.c:89:13: danger: ‘<unknown>’ leaks here; was allocated at [(12)](sarif:/runs/0/results/12/codeFlows/0/threadFlows/0/locations/11) # 87| /* mask */ # 88| if (im->image8) { # 89|-> ImagingSectionEnter(&cookie); # 90| for (y = 0; y < im->ysize; y++) { # 91| for (x = 0; x < im->xsize; x++) { Error: GCC_ANALYZER_WARNING (CWE-401): [#def57] Pillow-12.1.0/src/libImaging/Histo.c:97:13: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’ Pillow-12.1.0/src/libImaging/Histo.c:60:1: enter_function: entry to ‘ImagingGetHistogram’ Pillow-12.1.0/src/libImaging/Histo.c:67:8: branch_false: following ‘false’ branch (when ‘im’ is non-NULL)... Pillow-12.1.0/src/libImaging/Histo.c:71:8: branch_false: ...to here Pillow-12.1.0/src/libImaging/Histo.c:73:12: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Histo.c:76:12: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Histo.c:81:9: branch_false: ...to here Pillow-12.1.0/src/libImaging/Histo.c:81:9: call_function: calling ‘ImagingHistogramNew’ from ‘ImagingGetHistogram’ Pillow-12.1.0/src/libImaging/Histo.c:81:9: return_function: returning to ‘ImagingGetHistogram’ from ‘ImagingHistogramNew’ Pillow-12.1.0/src/libImaging/Histo.c:82:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Histo.c:86:8: branch_false: ...to here Pillow-12.1.0/src/libImaging/Histo.c:86:8: branch_true: following ‘true’ branch (when ‘imMask’ is non-NULL)... Pillow-12.1.0/src/libImaging/Histo.c:88:13: branch_true: ...to here Pillow-12.1.0/src/libImaging/Histo.c:88:12: branch_true: following ‘true’ branch... Pillow-12.1.0/src/libImaging/Histo.c:89:13: branch_true: ...to here Pillow-12.1.0/src/libImaging/Histo.c:97:13: throw: if ‘ImagingSectionLeave’ throws an exception... Pillow-12.1.0/src/libImaging/Histo.c:97:13: danger: ‘<unknown>’ leaks here; was allocated at [(12)](sarif:/runs/0/results/13/codeFlows/0/threadFlows/0/locations/11) # 95| } # 96| } # 97|-> ImagingSectionLeave(&cookie); # 98| } else { /* yes, we need the braces. C isn't Python! */ # 99| if (im->type != IMAGING_TYPE_UINT8) { Error: GCC_ANALYZER_WARNING (CWE-401): [#def58] Pillow-12.1.0/src/libImaging/Histo.c:103:13: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’ Pillow-12.1.0/src/libImaging/Histo.c:60:1: enter_function: entry to ‘ImagingGetHistogram’ Pillow-12.1.0/src/libImaging/Histo.c:67:8: branch_false: following ‘false’ branch (when ‘im’ is non-NULL)... Pillow-12.1.0/src/libImaging/Histo.c:71:8: branch_false: ...to here Pillow-12.1.0/src/libImaging/Histo.c:73:12: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Histo.c:76:12: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Histo.c:81:9: branch_false: ...to here Pillow-12.1.0/src/libImaging/Histo.c:81:9: call_function: calling ‘ImagingHistogramNew’ from ‘ImagingGetHistogram’ Pillow-12.1.0/src/libImaging/Histo.c:81:9: return_function: returning to ‘ImagingGetHistogram’ from ‘ImagingHistogramNew’ Pillow-12.1.0/src/libImaging/Histo.c:82:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Histo.c:86:8: branch_false: ...to here Pillow-12.1.0/src/libImaging/Histo.c:86:8: branch_true: following ‘true’ branch (when ‘imMask’ is non-NULL)... Pillow-12.1.0/src/libImaging/Histo.c:88:13: branch_true: ...to here Pillow-12.1.0/src/libImaging/Histo.c:88:12: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Histo.c:99:17: branch_false: ...to here Pillow-12.1.0/src/libImaging/Histo.c:99:16: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Histo.c:103:13: branch_false: ...to here Pillow-12.1.0/src/libImaging/Histo.c:103:13: throw: if ‘ImagingSectionEnter’ throws an exception... Pillow-12.1.0/src/libImaging/Histo.c:103:13: danger: ‘<unknown>’ leaks here; was allocated at [(12)](sarif:/runs/0/results/14/codeFlows/0/threadFlows/0/locations/11) # 101| return ImagingError_ModeError(); # 102| } # 103|-> ImagingSectionEnter(&cookie); # 104| for (y = 0; y < im->ysize; y++) { # 105| UINT8 *in = (UINT8 *)im->image32[y]; Error: GCC_ANALYZER_WARNING (CWE-401): [#def59] Pillow-12.1.0/src/libImaging/Histo.c:117:13: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’ Pillow-12.1.0/src/libImaging/Histo.c:60:1: enter_function: entry to ‘ImagingGetHistogram’ Pillow-12.1.0/src/libImaging/Histo.c:67:8: branch_false: following ‘false’ branch (when ‘im’ is non-NULL)... Pillow-12.1.0/src/libImaging/Histo.c:71:8: branch_false: ...to here Pillow-12.1.0/src/libImaging/Histo.c:73:12: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Histo.c:76:12: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Histo.c:81:9: branch_false: ...to here Pillow-12.1.0/src/libImaging/Histo.c:81:9: call_function: calling ‘ImagingHistogramNew’ from ‘ImagingGetHistogram’ Pillow-12.1.0/src/libImaging/Histo.c:81:9: return_function: returning to ‘ImagingGetHistogram’ from ‘ImagingHistogramNew’ Pillow-12.1.0/src/libImaging/Histo.c:82:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Histo.c:86:8: branch_false: ...to here Pillow-12.1.0/src/libImaging/Histo.c:86:8: branch_true: following ‘true’ branch (when ‘imMask’ is non-NULL)... Pillow-12.1.0/src/libImaging/Histo.c:88:13: branch_true: ...to here Pillow-12.1.0/src/libImaging/Histo.c:88:12: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Histo.c:99:17: branch_false: ...to here Pillow-12.1.0/src/libImaging/Histo.c:99:16: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Histo.c:103:13: branch_false: ...to here Pillow-12.1.0/src/libImaging/Histo.c:117:13: throw: if ‘ImagingSectionLeave’ throws an exception... Pillow-12.1.0/src/libImaging/Histo.c:117:13: danger: ‘<unknown>’ leaks here; was allocated at [(12)](sarif:/runs/0/results/15/codeFlows/0/threadFlows/0/locations/11) # 115| } # 116| } # 117|-> ImagingSectionLeave(&cookie); # 118| } # 119| } else { Error: GCC_ANALYZER_WARNING (CWE-401): [#def60] Pillow-12.1.0/src/libImaging/Histo.c:122:13: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’ Pillow-12.1.0/src/libImaging/Histo.c:60:1: enter_function: entry to ‘ImagingGetHistogram’ Pillow-12.1.0/src/libImaging/Histo.c:67:8: branch_false: following ‘false’ branch (when ‘im’ is non-NULL)... Pillow-12.1.0/src/libImaging/Histo.c:71:8: branch_false: ...to here Pillow-12.1.0/src/libImaging/Histo.c:81:9: call_function: calling ‘ImagingHistogramNew’ from ‘ImagingGetHistogram’ Pillow-12.1.0/src/libImaging/Histo.c:81:9: return_function: returning to ‘ImagingGetHistogram’ from ‘ImagingHistogramNew’ Pillow-12.1.0/src/libImaging/Histo.c:82:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Histo.c:86:8: branch_false: ...to here Pillow-12.1.0/src/libImaging/Histo.c:86:8: branch_false: following ‘false’ branch (when ‘imMask’ is NULL)... Pillow-12.1.0/src/libImaging/Histo.c:121:13: branch_false: ...to here Pillow-12.1.0/src/libImaging/Histo.c:121:12: branch_true: following ‘true’ branch... Pillow-12.1.0/src/libImaging/Histo.c:122:13: branch_true: ...to here Pillow-12.1.0/src/libImaging/Histo.c:122:13: throw: if ‘ImagingSectionEnter’ throws an exception... Pillow-12.1.0/src/libImaging/Histo.c:122:13: danger: ‘<unknown>’ leaks here; was allocated at [(8)](sarif:/runs/0/results/16/codeFlows/0/threadFlows/0/locations/7) # 120| /* mask not given; process pixels in image */ # 121| if (im->image8) { # 122|-> ImagingSectionEnter(&cookie); # 123| for (y = 0; y < im->ysize; y++) { # 124| for (x = 0; x < im->xsize; x++) { Error: GCC_ANALYZER_WARNING (CWE-401): [#def61] Pillow-12.1.0/src/libImaging/Histo.c:128:13: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’ Pillow-12.1.0/src/libImaging/Histo.c:60:1: enter_function: entry to ‘ImagingGetHistogram’ Pillow-12.1.0/src/libImaging/Histo.c:67:8: branch_false: following ‘false’ branch (when ‘im’ is non-NULL)... Pillow-12.1.0/src/libImaging/Histo.c:71:8: branch_false: ...to here Pillow-12.1.0/src/libImaging/Histo.c:81:9: call_function: calling ‘ImagingHistogramNew’ from ‘ImagingGetHistogram’ Pillow-12.1.0/src/libImaging/Histo.c:81:9: return_function: returning to ‘ImagingGetHistogram’ from ‘ImagingHistogramNew’ Pillow-12.1.0/src/libImaging/Histo.c:82:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Histo.c:86:8: branch_false: ...to here Pillow-12.1.0/src/libImaging/Histo.c:86:8: branch_false: following ‘false’ branch (when ‘imMask’ is NULL)... Pillow-12.1.0/src/libImaging/Histo.c:121:13: branch_false: ...to here Pillow-12.1.0/src/libImaging/Histo.c:121:12: branch_true: following ‘true’ branch... Pillow-12.1.0/src/libImaging/Histo.c:122:13: branch_true: ...to here Pillow-12.1.0/src/libImaging/Histo.c:128:13: throw: if ‘ImagingSectionLeave’ throws an exception... Pillow-12.1.0/src/libImaging/Histo.c:128:13: danger: ‘<unknown>’ leaks here; was allocated at [(8)](sarif:/runs/0/results/17/codeFlows/0/threadFlows/0/locations/7) # 126| } # 127| } # 128|-> ImagingSectionLeave(&cookie); # 129| } else { # 130| switch (im->type) { Error: GCC_ANALYZER_WARNING (CWE-401): [#def62] Pillow-12.1.0/src/libImaging/Histo.c:132:21: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’ Pillow-12.1.0/src/libImaging/Histo.c:60:1: enter_function: entry to ‘ImagingGetHistogram’ Pillow-12.1.0/src/libImaging/Histo.c:67:8: branch_false: following ‘false’ branch (when ‘im’ is non-NULL)... Pillow-12.1.0/src/libImaging/Histo.c:71:8: branch_false: ...to here Pillow-12.1.0/src/libImaging/Histo.c:81:9: call_function: calling ‘ImagingHistogramNew’ from ‘ImagingGetHistogram’ Pillow-12.1.0/src/libImaging/Histo.c:81:9: return_function: returning to ‘ImagingGetHistogram’ from ‘ImagingHistogramNew’ Pillow-12.1.0/src/libImaging/Histo.c:82:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Histo.c:86:8: branch_false: ...to here Pillow-12.1.0/src/libImaging/Histo.c:86:8: branch_false: following ‘false’ branch (when ‘imMask’ is NULL)... Pillow-12.1.0/src/libImaging/Histo.c:121:13: branch_false: ...to here Pillow-12.1.0/src/libImaging/Histo.c:121:12: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Histo.c:130:21: branch_false: ...to here Pillow-12.1.0/src/libImaging/Histo.c:132:21: throw: if ‘ImagingSectionEnter’ throws an exception... Pillow-12.1.0/src/libImaging/Histo.c:132:21: danger: ‘<unknown>’ leaks here; was allocated at [(8)](sarif:/runs/0/results/18/codeFlows/0/threadFlows/0/locations/7) # 130| switch (im->type) { # 131| case IMAGING_TYPE_UINT8: # 132|-> ImagingSectionEnter(&cookie); # 133| for (y = 0; y < im->ysize; y++) { # 134| UINT8 *in = (UINT8 *)im->image[y]; Error: GCC_ANALYZER_WARNING (CWE-401): [#def63] Pillow-12.1.0/src/libImaging/Histo.c:146:21: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’ Pillow-12.1.0/src/libImaging/Histo.c:60:1: enter_function: entry to ‘ImagingGetHistogram’ Pillow-12.1.0/src/libImaging/Histo.c:67:8: branch_false: following ‘false’ branch (when ‘im’ is non-NULL)... Pillow-12.1.0/src/libImaging/Histo.c:71:8: branch_false: ...to here Pillow-12.1.0/src/libImaging/Histo.c:81:9: call_function: calling ‘ImagingHistogramNew’ from ‘ImagingGetHistogram’ Pillow-12.1.0/src/libImaging/Histo.c:81:9: return_function: returning to ‘ImagingGetHistogram’ from ‘ImagingHistogramNew’ Pillow-12.1.0/src/libImaging/Histo.c:82:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Histo.c:86:8: branch_false: ...to here Pillow-12.1.0/src/libImaging/Histo.c:86:8: branch_false: following ‘false’ branch (when ‘imMask’ is NULL)... Pillow-12.1.0/src/libImaging/Histo.c:121:13: branch_false: ...to here Pillow-12.1.0/src/libImaging/Histo.c:121:12: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Histo.c:130:21: branch_false: ...to here Pillow-12.1.0/src/libImaging/Histo.c:146:21: throw: if ‘ImagingSectionLeave’ throws an exception... Pillow-12.1.0/src/libImaging/Histo.c:146:21: danger: ‘<unknown>’ leaks here; was allocated at [(8)](sarif:/runs/0/results/19/codeFlows/0/threadFlows/0/locations/7) # 144| } # 145| } # 146|-> ImagingSectionLeave(&cookie); # 147| break; # 148| case IMAGING_TYPE_INT32: Error: GCC_ANALYZER_WARNING (CWE-401): [#def64] Pillow-12.1.0/src/libImaging/Histo.c:161:21: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’ Pillow-12.1.0/src/libImaging/Histo.c:60:1: enter_function: entry to ‘ImagingGetHistogram’ Pillow-12.1.0/src/libImaging/Histo.c:67:8: branch_false: following ‘false’ branch (when ‘im’ is non-NULL)... Pillow-12.1.0/src/libImaging/Histo.c:71:8: branch_false: ...to here Pillow-12.1.0/src/libImaging/Histo.c:81:9: call_function: calling ‘ImagingHistogramNew’ from ‘ImagingGetHistogram’ Pillow-12.1.0/src/libImaging/Histo.c:81:9: return_function: returning to ‘ImagingGetHistogram’ from ‘ImagingHistogramNew’ Pillow-12.1.0/src/libImaging/Histo.c:82:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Histo.c:86:8: branch_false: ...to here Pillow-12.1.0/src/libImaging/Histo.c:86:8: branch_false: following ‘false’ branch (when ‘imMask’ is NULL)... Pillow-12.1.0/src/libImaging/Histo.c:121:13: branch_false: ...to here Pillow-12.1.0/src/libImaging/Histo.c:121:12: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Histo.c:130:21: branch_false: ...to here Pillow-12.1.0/src/libImaging/Histo.c:149:24: branch_false: following ‘false’ branch (when ‘minmax’ is non-NULL)... Pillow-12.1.0/src/libImaging/Histo.c:153:26: branch_false: ...to here Pillow-12.1.0/src/libImaging/Histo.c:153:24: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Histo.c:158:24: branch_false: following ‘false’ branch (when ‘imin < imax’)... Pillow-12.1.0/src/libImaging/Histo.c:161:21: branch_false: ...to here Pillow-12.1.0/src/libImaging/Histo.c:161:21: throw: if ‘ImagingSectionEnter’ throws an exception... Pillow-12.1.0/src/libImaging/Histo.c:161:21: danger: ‘<unknown>’ leaks here; was allocated at [(8)](sarif:/runs/0/results/20/codeFlows/0/threadFlows/0/locations/7) # 159| break; # 160| } # 161|-> ImagingSectionEnter(&cookie); # 162| scale = 255.0F / (imax - imin); # 163| for (y = 0; y < im->ysize; y++) { Error: GCC_ANALYZER_WARNING (CWE-401): [#def65] Pillow-12.1.0/src/libImaging/Histo.c:172:21: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’ Pillow-12.1.0/src/libImaging/Histo.c:60:1: enter_function: entry to ‘ImagingGetHistogram’ Pillow-12.1.0/src/libImaging/Histo.c:67:8: branch_false: following ‘false’ branch (when ‘im’ is non-NULL)... Pillow-12.1.0/src/libImaging/Histo.c:71:8: branch_false: ...to here Pillow-12.1.0/src/libImaging/Histo.c:81:9: call_function: calling ‘ImagingHistogramNew’ from ‘ImagingGetHistogram’ Pillow-12.1.0/src/libImaging/Histo.c:81:9: return_function: returning to ‘ImagingGetHistogram’ from ‘ImagingHistogramNew’ Pillow-12.1.0/src/libImaging/Histo.c:82:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Histo.c:86:8: branch_false: ...to here Pillow-12.1.0/src/libImaging/Histo.c:86:8: branch_false: following ‘false’ branch (when ‘imMask’ is NULL)... Pillow-12.1.0/src/libImaging/Histo.c:121:13: branch_false: ...to here Pillow-12.1.0/src/libImaging/Histo.c:121:12: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Histo.c:130:21: branch_false: ...to here Pillow-12.1.0/src/libImaging/Histo.c:149:24: branch_false: following ‘false’ branch (when ‘minmax’ is non-NULL)... Pillow-12.1.0/src/libImaging/Histo.c:153:26: branch_false: ...to here Pillow-12.1.0/src/libImaging/Histo.c:153:24: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Histo.c:158:24: branch_false: following ‘false’ branch (when ‘imin < imax’)... Pillow-12.1.0/src/libImaging/Histo.c:161:21: branch_false: ...to here Pillow-12.1.0/src/libImaging/Histo.c:172:21: throw: if ‘ImagingSectionLeave’ throws an exception... Pillow-12.1.0/src/libImaging/Histo.c:172:21: danger: ‘<unknown>’ leaks here; was allocated at [(8)](sarif:/runs/0/results/21/codeFlows/0/threadFlows/0/locations/7) # 170| } # 171| } # 172|-> ImagingSectionLeave(&cookie); # 173| break; # 174| case IMAGING_TYPE_FLOAT32: Error: GCC_ANALYZER_WARNING (CWE-401): [#def66] Pillow-12.1.0/src/libImaging/Histo.c:187:21: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’ Pillow-12.1.0/src/libImaging/Histo.c:60:1: enter_function: entry to ‘ImagingGetHistogram’ Pillow-12.1.0/src/libImaging/Histo.c:67:8: branch_false: following ‘false’ branch (when ‘im’ is non-NULL)... Pillow-12.1.0/src/libImaging/Histo.c:71:8: branch_false: ...to here Pillow-12.1.0/src/libImaging/Histo.c:81:9: call_function: calling ‘ImagingHistogramNew’ from ‘ImagingGetHistogram’ Pillow-12.1.0/src/libImaging/Histo.c:81:9: return_function: returning to ‘ImagingGetHistogram’ from ‘ImagingHistogramNew’ Pillow-12.1.0/src/libImaging/Histo.c:82:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Histo.c:86:8: branch_false: ...to here Pillow-12.1.0/src/libImaging/Histo.c:86:8: branch_false: following ‘false’ branch (when ‘imMask’ is NULL)... Pillow-12.1.0/src/libImaging/Histo.c:121:13: branch_false: ...to here Pillow-12.1.0/src/libImaging/Histo.c:121:12: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Histo.c:130:21: branch_false: ...to here Pillow-12.1.0/src/libImaging/Histo.c:175:24: branch_false: following ‘false’ branch (when ‘minmax’ is non-NULL)... Pillow-12.1.0/src/libImaging/Histo.c:179:26: branch_false: ...to here Pillow-12.1.0/src/libImaging/Histo.c:179:24: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Histo.c:184:24: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Histo.c:187:21: branch_false: ...to here Pillow-12.1.0/src/libImaging/Histo.c:187:21: throw: if ‘ImagingSectionEnter’ throws an exception... Pillow-12.1.0/src/libImaging/Histo.c:187:21: danger: ‘<unknown>’ leaks here; was allocated at [(8)](sarif:/runs/0/results/22/codeFlows/0/threadFlows/0/locations/7) # 185| break; # 186| } # 187|-> ImagingSectionEnter(&cookie); # 188| scale = 255.0F / (fmax - fmin); # 189| for (y = 0; y < im->ysize; y++) { Error: GCC_ANALYZER_WARNING (CWE-401): [#def67] Pillow-12.1.0/src/libImaging/Histo.c:198:21: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’ Pillow-12.1.0/src/libImaging/Histo.c:60:1: enter_function: entry to ‘ImagingGetHistogram’ Pillow-12.1.0/src/libImaging/Histo.c:67:8: branch_false: following ‘false’ branch (when ‘im’ is non-NULL)... Pillow-12.1.0/src/libImaging/Histo.c:71:8: branch_false: ...to here Pillow-12.1.0/src/libImaging/Histo.c:81:9: call_function: calling ‘ImagingHistogramNew’ from ‘ImagingGetHistogram’ Pillow-12.1.0/src/libImaging/Histo.c:81:9: return_function: returning to ‘ImagingGetHistogram’ from ‘ImagingHistogramNew’ Pillow-12.1.0/src/libImaging/Histo.c:82:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Histo.c:86:8: branch_false: ...to here Pillow-12.1.0/src/libImaging/Histo.c:86:8: branch_false: following ‘false’ branch (when ‘imMask’ is NULL)... Pillow-12.1.0/src/libImaging/Histo.c:121:13: branch_false: ...to here Pillow-12.1.0/src/libImaging/Histo.c:121:12: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Histo.c:130:21: branch_false: ...to here Pillow-12.1.0/src/libImaging/Histo.c:175:24: branch_false: following ‘false’ branch (when ‘minmax’ is non-NULL)... Pillow-12.1.0/src/libImaging/Histo.c:179:26: branch_false: ...to here Pillow-12.1.0/src/libImaging/Histo.c:179:24: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Histo.c:184:24: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Histo.c:187:21: branch_false: ...to here Pillow-12.1.0/src/libImaging/Histo.c:198:21: throw: if ‘ImagingSectionLeave’ throws an exception... Pillow-12.1.0/src/libImaging/Histo.c:198:21: danger: ‘<unknown>’ leaks here; was allocated at [(8)](sarif:/runs/0/results/23/codeFlows/0/threadFlows/0/locations/7) # 196| } # 197| } # 198|-> ImagingSectionLeave(&cookie); # 199| break; # 200| } Error: GCC_ANALYZER_WARNING (CWE-401): [#def68] Pillow-12.1.0/src/libImaging/Quant.c:157:12: warning[-Wanalyzer-malloc-leak]: leak of ‘d’ Pillow-12.1.0/src/libImaging/Quant.c:1291:1: enter_function: entry to ‘quantize’ Pillow-12.1.0/src/libImaging/Quant.c:1321:9: call_function: calling ‘create_pixel_hash’ from ‘quantize’ # 155| return NULL; # 156| } # 157|-> hash = hashtable_new(pixel_hash, pixel_cmp); # 158| hashtable_set_user_data(hash, d); # 159| d->scale = 0; Error: GCC_ANALYZER_WARNING (CWE-401): [#def69] Pillow-12.1.0/src/libImaging/Quant.c:157:12: warning[-Wanalyzer-malloc-leak]: leak of ‘p’ Pillow-12.1.0/src/libImaging/Quant.c:1665:1: enter_function: entry to ‘ImagingQuantize’ Pillow-12.1.0/src/libImaging/Quant.c:1678:8: branch_false: following ‘false’ branch (when ‘im’ is non-NULL)... Pillow-12.1.0/src/libImaging/Quant.c:1681:9: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1681:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Quant.c:1687:9: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1697:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Quant.c:1701:16: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1701:9: acquire_memory: allocated here Pillow-12.1.0/src/libImaging/Quant.c:1702:8: branch_false: following ‘false’ branch (when ‘p’ is non-NULL)... Pillow-12.1.0/src/libImaging/Quant.c:1711:8: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1779:22: call_function: calling ‘quantize’ from ‘ImagingQuantize’ # 155| return NULL; # 156| } # 157|-> hash = hashtable_new(pixel_hash, pixel_cmp); # 158| hashtable_set_user_data(hash, d); # 159| d->scale = 0; Error: GCC_ANALYZER_WARNING (CWE-401): [#def70] Pillow-12.1.0/src/libImaging/Quant.c:158:5: warning[-Wanalyzer-malloc-leak]: leak of ‘d’ Pillow-12.1.0/src/libImaging/Quant.c:1291:1: enter_function: entry to ‘quantize’ Pillow-12.1.0/src/libImaging/Quant.c:1321:9: call_function: calling ‘create_pixel_hash’ from ‘quantize’ # 156| } # 157| hash = hashtable_new(pixel_hash, pixel_cmp); # 158|-> hashtable_set_user_data(hash, d); # 159| d->scale = 0; # 160| #ifdef DEBUG Error: GCC_ANALYZER_WARNING (CWE-401): [#def71] Pillow-12.1.0/src/libImaging/Quant.c:158:5: warning[-Wanalyzer-malloc-leak]: leak of ‘p’ Pillow-12.1.0/src/libImaging/Quant.c:1665:1: enter_function: entry to ‘ImagingQuantize’ Pillow-12.1.0/src/libImaging/Quant.c:1678:8: branch_false: following ‘false’ branch (when ‘im’ is non-NULL)... Pillow-12.1.0/src/libImaging/Quant.c:1681:9: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1681:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Quant.c:1687:9: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1697:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Quant.c:1701:16: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1701:9: acquire_memory: allocated here Pillow-12.1.0/src/libImaging/Quant.c:1702:8: branch_false: following ‘false’ branch (when ‘p’ is non-NULL)... Pillow-12.1.0/src/libImaging/Quant.c:1711:8: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1779:22: call_function: calling ‘quantize’ from ‘ImagingQuantize’ # 156| } # 157| hash = hashtable_new(pixel_hash, pixel_cmp); # 158|-> hashtable_set_user_data(hash, d); # 159| d->scale = 0; # 160| #ifdef DEBUG Error: GCC_ANALYZER_WARNING (CWE-401): [#def72] Pillow-12.1.0/src/libImaging/Quant.c:164:14: warning[-Wanalyzer-malloc-leak]: leak of ‘p’ Pillow-12.1.0/src/libImaging/Quant.c:1665:1: enter_function: entry to ‘ImagingQuantize’ Pillow-12.1.0/src/libImaging/Quant.c:1678:8: branch_false: following ‘false’ branch (when ‘im’ is non-NULL)... Pillow-12.1.0/src/libImaging/Quant.c:1681:9: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1681:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Quant.c:1687:9: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1697:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Quant.c:1701:16: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1701:9: acquire_memory: allocated here Pillow-12.1.0/src/libImaging/Quant.c:1702:8: branch_false: following ‘false’ branch (when ‘p’ is non-NULL)... Pillow-12.1.0/src/libImaging/Quant.c:1711:8: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1779:22: call_function: calling ‘quantize’ from ‘ImagingQuantize’ # 162| #endif # 163| for (i = 0; i < nPixels; i++) { # 164|-> if (!hashtable_insert_or_update_computed( # 165| hash, pixelData[i], new_count_func, exists_count_func # 166| )) { Error: GCC_ANALYZER_WARNING (CWE-401): [#def73] Pillow-12.1.0/src/libImaging/Quant.c:169:16: warning[-Wanalyzer-malloc-leak]: leak of ‘p’ Pillow-12.1.0/src/libImaging/Quant.c:1665:1: enter_function: entry to ‘ImagingQuantize’ Pillow-12.1.0/src/libImaging/Quant.c:1678:8: branch_false: following ‘false’ branch (when ‘im’ is non-NULL)... Pillow-12.1.0/src/libImaging/Quant.c:1681:9: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1681:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Quant.c:1687:9: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1697:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Quant.c:1701:16: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1701:9: acquire_memory: allocated here Pillow-12.1.0/src/libImaging/Quant.c:1702:8: branch_false: following ‘false’ branch (when ‘p’ is non-NULL)... Pillow-12.1.0/src/libImaging/Quant.c:1711:8: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1779:22: call_function: calling ‘quantize’ from ‘ImagingQuantize’ # 167| ; # 168| } # 169|-> while (hashtable_get_count(hash) > MAX_HASH_ENTRIES) { # 170| d->scale++; # 171| #ifdef DEBUG Error: GCC_ANALYZER_WARNING (CWE-401): [#def74] Pillow-12.1.0/src/libImaging/Quant.c:663:9: warning[-Wanalyzer-malloc-leak]: leak of ‘p’ Pillow-12.1.0/src/libImaging/Quant.c:1665:1: enter_function: entry to ‘ImagingQuantize’ Pillow-12.1.0/src/libImaging/Quant.c:1678:8: branch_false: following ‘false’ branch (when ‘im’ is non-NULL)... Pillow-12.1.0/src/libImaging/Quant.c:1681:9: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1681:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Quant.c:1687:9: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1697:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Quant.c:1701:16: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1701:9: acquire_memory: allocated here Pillow-12.1.0/src/libImaging/Quant.c:1702:8: branch_false: following ‘false’ branch (when ‘p’ is non-NULL)... Pillow-12.1.0/src/libImaging/Quant.c:1711:8: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1779:22: call_function: calling ‘quantize’ from ‘ImagingQuantize’ # 661| BoxNode *thisNode; # 662| # 663|-> h = ImagingQuantHeapNew(box_heap_cmp); # 664| /* malloc check ok, small constant allocation */ # 665| root = malloc(sizeof(BoxNode)); Error: GCC_ANALYZER_WARNING (CWE-401): [#def75] Pillow-12.1.0/src/libImaging/Quant.c:836:9: warning[-Wanalyzer-malloc-leak]: leak of ‘avgDistSortKey’ Pillow-12.1.0/src/libImaging/Quant.c:1566:1: enter_function: entry to ‘quantize2’ Pillow-12.1.0/src/libImaging/Quant.c:1587:8: branch_false: following ‘false’ branch (when ‘p’ is non-NULL)... Pillow-12.1.0/src/libImaging/Quant.c:1591:9: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1601:17: branch_true: following ‘true’ branch (when ‘i < nQuantPixels’)... Pillow-12.1.0/src/libImaging/Quant.c:1602:9: branch_true: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1613:8: branch_false: following ‘false’ branch (when ‘qp’ is non-NULL)... Pillow-12.1.0/src/libImaging/Quant.c:1613:8: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1617:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Quant.c:1622:22: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1623:8: branch_false: following ‘false’ branch (when ‘avgDist’ is non-NULL)... Pillow-12.1.0/src/libImaging/Quant.c:1628:22: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1628:22: acquire_memory: allocated here Pillow-12.1.0/src/libImaging/Quant.c:1629:8: branch_false: following ‘false’ branch (when ‘avgDistSortKey’ is non-NULL)... Pillow-12.1.0/src/libImaging/Quant.c:1633:10: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1633:10: call_function: calling ‘build_distance_tables’ from ‘quantize2’ # 834| dwi[j] = (DistanceWithIndex){&(avgDist[i * nEntries + j]), j}; # 835| } # 836|-> qsort(dwi, nEntries, sizeof(DistanceWithIndex), _distance_index_cmp); # 837| for (j = 0; j < nEntries; j++) { # 838| avgDistSortKey[i * nEntries + j] = dwi[j].distance; Error: GCC_ANALYZER_WARNING (CWE-401): [#def76] Pillow-12.1.0/src/libImaging/Quant.c:836:9: warning[-Wanalyzer-malloc-leak]: leak of ‘avgDist’ Pillow-12.1.0/src/libImaging/Quant.c:1566:1: enter_function: entry to ‘quantize2’ Pillow-12.1.0/src/libImaging/Quant.c:1587:8: branch_false: following ‘false’ branch (when ‘p’ is non-NULL)... Pillow-12.1.0/src/libImaging/Quant.c:1591:9: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1601:17: branch_true: following ‘true’ branch (when ‘i < nQuantPixels’)... Pillow-12.1.0/src/libImaging/Quant.c:1602:9: branch_true: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1613:8: branch_false: following ‘false’ branch (when ‘qp’ is non-NULL)... Pillow-12.1.0/src/libImaging/Quant.c:1613:8: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1617:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Quant.c:1622:22: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1622:15: acquire_memory: allocated here Pillow-12.1.0/src/libImaging/Quant.c:1623:8: branch_false: following ‘false’ branch (when ‘avgDist’ is non-NULL)... Pillow-12.1.0/src/libImaging/Quant.c:1628:22: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1629:8: branch_false: following ‘false’ branch (when ‘avgDistSortKey’ is non-NULL)... Pillow-12.1.0/src/libImaging/Quant.c:1633:10: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1633:10: call_function: calling ‘build_distance_tables’ from ‘quantize2’ # 834| dwi[j] = (DistanceWithIndex){&(avgDist[i * nEntries + j]), j}; # 835| } # 836|-> qsort(dwi, nEntries, sizeof(DistanceWithIndex), _distance_index_cmp); # 837| for (j = 0; j < nEntries; j++) { # 838| avgDistSortKey[i * nEntries + j] = dwi[j].distance; Error: GCC_ANALYZER_WARNING (CWE-401): [#def77] Pillow-12.1.0/src/libImaging/Quant.c:836:9: warning[-Wanalyzer-malloc-leak]: leak of ‘count’ Pillow-12.1.0/src/libImaging/Quant.c:1159:1: enter_function: entry to ‘k_means’ Pillow-12.1.0/src/libImaging/Quant.c:1179:19: acquire_memory: allocated here Pillow-12.1.0/src/libImaging/Quant.c:1179:8: branch_false: following ‘false’ branch (when ‘count’ is non-NULL)... Pillow-12.1.0/src/libImaging/Quant.c:1179:8: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1182:17: branch_true: following ‘true’ branch (when ‘i != 3’)... Pillow-12.1.0/src/libImaging/Quant.c:1183:9: branch_true: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1185:17: branch_true: following ‘true’ branch (when ‘i != 3’)... Pillow-12.1.0/src/libImaging/Quant.c:1187:24: branch_true: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1187:12: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Quant.c:1185:24: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1185:17: branch_true: following ‘true’ branch (when ‘i != 3’)... Pillow-12.1.0/src/libImaging/Quant.c:1187:24: branch_true: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1187:12: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Quant.c:1185:24: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1185:17: branch_true: following ‘true’ branch (when ‘i != 3’)... Pillow-12.1.0/src/libImaging/Quant.c:1187:24: branch_true: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1187:12: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Quant.c:1185:24: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1185:17: branch_false: following ‘false’ branch (when ‘i == 3’)... Pillow-12.1.0/src/libImaging/Quant.c:1185:17: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1193:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Quant.c:1197:22: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1198:8: branch_false: following ‘false’ branch (when ‘avgDist’ is non-NULL)... Pillow-12.1.0/src/libImaging/Quant.c:1203:22: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1204:8: branch_false: following ‘false’ branch (when ‘avgDistSortKey’ is non-NULL)... Pillow-12.1.0/src/libImaging/Quant.c:1204:8: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1213:12: branch_true: following ‘true’ branch (when ‘built == 0’)... Pillow-12.1.0/src/libImaging/Quant.c:1214:13: branch_true: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1214:13: call_function: calling ‘compute_palette_from_quantized_pixels’ from ‘k_means’ Pillow-12.1.0/src/libImaging/Quant.c:1214:13: return_function: returning to ‘k_means’ from ‘compute_palette_from_quantized_pixels’ Pillow-12.1.0/src/libImaging/Quant.c:1217:18: call_function: calling ‘build_distance_tables’ from ‘k_means’ # 834| dwi[j] = (DistanceWithIndex){&(avgDist[i * nEntries + j]), j}; # 835| } # 836|-> qsort(dwi, nEntries, sizeof(DistanceWithIndex), _distance_index_cmp); # 837| for (j = 0; j < nEntries; j++) { # 838| avgDistSortKey[i * nEntries + j] = dwi[j].distance; Error: GCC_ANALYZER_WARNING (CWE-401): [#def78] Pillow-12.1.0/src/libImaging/Quant.c:836:9: warning[-Wanalyzer-malloc-leak]: leak of ‘dwi’ Pillow-12.1.0/src/libImaging/Quant.c:1566:1: enter_function: entry to ‘quantize2’ Pillow-12.1.0/src/libImaging/Quant.c:1587:8: branch_false: following ‘false’ branch (when ‘p’ is non-NULL)... Pillow-12.1.0/src/libImaging/Quant.c:1591:9: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1601:17: branch_true: following ‘true’ branch (when ‘i < nQuantPixels’)... Pillow-12.1.0/src/libImaging/Quant.c:1602:9: branch_true: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1613:8: branch_false: following ‘false’ branch (when ‘qp’ is non-NULL)... Pillow-12.1.0/src/libImaging/Quant.c:1613:8: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1617:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Quant.c:1622:22: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1623:8: branch_false: following ‘false’ branch (when ‘avgDist’ is non-NULL)... Pillow-12.1.0/src/libImaging/Quant.c:1628:22: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1629:8: branch_false: following ‘false’ branch (when ‘avgDistSortKey’ is non-NULL)... Pillow-12.1.0/src/libImaging/Quant.c:1633:10: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1633:10: call_function: calling ‘build_distance_tables’ from ‘quantize2’ # 834| dwi[j] = (DistanceWithIndex){&(avgDist[i * nEntries + j]), j}; # 835| } # 836|-> qsort(dwi, nEntries, sizeof(DistanceWithIndex), _distance_index_cmp); # 837| for (j = 0; j < nEntries; j++) { # 838| avgDistSortKey[i * nEntries + j] = dwi[j].distance; Error: GCC_ANALYZER_WARNING (CWE-401): [#def79] Pillow-12.1.0/src/libImaging/Quant.c:836:9: warning[-Wanalyzer-malloc-leak]: leak of ‘p’ Pillow-12.1.0/src/libImaging/Quant.c:1566:1: enter_function: entry to ‘quantize2’ Pillow-12.1.0/src/libImaging/Quant.c:1586:9: acquire_memory: allocated here Pillow-12.1.0/src/libImaging/Quant.c:1587:8: branch_false: following ‘false’ branch (when ‘p’ is non-NULL)... Pillow-12.1.0/src/libImaging/Quant.c:1591:9: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1601:17: branch_true: following ‘true’ branch (when ‘i < nQuantPixels’)... Pillow-12.1.0/src/libImaging/Quant.c:1602:9: branch_true: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1613:8: branch_false: following ‘false’ branch (when ‘qp’ is non-NULL)... Pillow-12.1.0/src/libImaging/Quant.c:1613:8: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1617:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Quant.c:1622:22: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1623:8: branch_false: following ‘false’ branch (when ‘avgDist’ is non-NULL)... Pillow-12.1.0/src/libImaging/Quant.c:1628:22: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1629:8: branch_false: following ‘false’ branch (when ‘avgDistSortKey’ is non-NULL)... Pillow-12.1.0/src/libImaging/Quant.c:1633:10: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1633:10: call_function: calling ‘build_distance_tables’ from ‘quantize2’ # 834| dwi[j] = (DistanceWithIndex){&(avgDist[i * nEntries + j]), j}; # 835| } # 836|-> qsort(dwi, nEntries, sizeof(DistanceWithIndex), _distance_index_cmp); # 837| for (j = 0; j < nEntries; j++) { # 838| avgDistSortKey[i * nEntries + j] = dwi[j].distance; Error: GCC_ANALYZER_WARNING (CWE-401): [#def80] Pillow-12.1.0/src/libImaging/Quant.c:836:9: warning[-Wanalyzer-malloc-leak]: leak of ‘qp’ Pillow-12.1.0/src/libImaging/Quant.c:1566:1: enter_function: entry to ‘quantize2’ Pillow-12.1.0/src/libImaging/Quant.c:1587:8: branch_false: following ‘false’ branch (when ‘p’ is non-NULL)... Pillow-12.1.0/src/libImaging/Quant.c:1591:9: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1601:17: branch_true: following ‘true’ branch (when ‘i < nQuantPixels’)... Pillow-12.1.0/src/libImaging/Quant.c:1602:9: branch_true: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1612:10: acquire_memory: allocated here Pillow-12.1.0/src/libImaging/Quant.c:1613:8: branch_false: following ‘false’ branch (when ‘qp’ is non-NULL)... Pillow-12.1.0/src/libImaging/Quant.c:1613:8: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1617:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Quant.c:1622:22: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1623:8: branch_false: following ‘false’ branch (when ‘avgDist’ is non-NULL)... Pillow-12.1.0/src/libImaging/Quant.c:1628:22: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1629:8: branch_false: following ‘false’ branch (when ‘avgDistSortKey’ is non-NULL)... Pillow-12.1.0/src/libImaging/Quant.c:1633:10: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1633:10: call_function: calling ‘build_distance_tables’ from ‘quantize2’ # 834| dwi[j] = (DistanceWithIndex){&(avgDist[i * nEntries + j]), j}; # 835| } # 836|-> qsort(dwi, nEntries, sizeof(DistanceWithIndex), _distance_index_cmp); # 837| for (j = 0; j < nEntries; j++) { # 838| avgDistSortKey[i * nEntries + j] = dwi[j].distance; Error: GCC_ANALYZER_WARNING (CWE-401): [#def81] Pillow-12.1.0/src/libImaging/Quant.c:862:10: warning[-Wanalyzer-malloc-leak]: leak of ‘avgDistSortKey’ Pillow-12.1.0/src/libImaging/Quant.c:1566:1: enter_function: entry to ‘quantize2’ Pillow-12.1.0/src/libImaging/Quant.c:1587:8: branch_false: following ‘false’ branch (when ‘p’ is non-NULL)... Pillow-12.1.0/src/libImaging/Quant.c:1591:9: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1601:17: branch_false: following ‘false’ branch (when ‘i >= nQuantPixels’)... Pillow-12.1.0/src/libImaging/Quant.c:1609:5: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1613:8: branch_false: following ‘false’ branch (when ‘qp’ is non-NULL)... Pillow-12.1.0/src/libImaging/Quant.c:1613:8: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1617:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Quant.c:1622:22: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1623:8: branch_false: following ‘false’ branch (when ‘avgDist’ is non-NULL)... Pillow-12.1.0/src/libImaging/Quant.c:1628:22: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1628:22: acquire_memory: allocated here Pillow-12.1.0/src/libImaging/Quant.c:1629:8: branch_false: following ‘false’ branch (when ‘avgDistSortKey’ is non-NULL)... Pillow-12.1.0/src/libImaging/Quant.c:1633:10: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1633:10: call_function: calling ‘build_distance_tables’ from ‘quantize2’ Pillow-12.1.0/src/libImaging/Quant.c:1633:10: return_function: returning to ‘quantize2’ from ‘build_distance_tables’ Pillow-12.1.0/src/libImaging/Quant.c:1633:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Quant.c:1637:10: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1637:10: call_function: calling ‘map_image_pixels’ from ‘quantize2’ # 860| HashTable *h2; # 861| # 862|-> h2 = hashtable_new(unshifted_pixel_hash, unshifted_pixel_cmp); # 863| for (i = 0; i < nPixels; i++) { # 864| if (!hashtable_lookup(h2, pixelData[i], &bestmatch)) { Error: GCC_ANALYZER_WARNING (CWE-401): [#def82] Pillow-12.1.0/src/libImaging/Quant.c:862:10: warning[-Wanalyzer-malloc-leak]: leak of ‘avgDist’ Pillow-12.1.0/src/libImaging/Quant.c:1566:1: enter_function: entry to ‘quantize2’ Pillow-12.1.0/src/libImaging/Quant.c:1587:8: branch_false: following ‘false’ branch (when ‘p’ is non-NULL)... Pillow-12.1.0/src/libImaging/Quant.c:1591:9: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1601:17: branch_false: following ‘false’ branch (when ‘i >= nQuantPixels’)... Pillow-12.1.0/src/libImaging/Quant.c:1609:5: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1613:8: branch_false: following ‘false’ branch (when ‘qp’ is non-NULL)... Pillow-12.1.0/src/libImaging/Quant.c:1613:8: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1617:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Quant.c:1622:22: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1622:15: acquire_memory: allocated here Pillow-12.1.0/src/libImaging/Quant.c:1623:8: branch_false: following ‘false’ branch (when ‘avgDist’ is non-NULL)... Pillow-12.1.0/src/libImaging/Quant.c:1628:22: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1629:8: branch_false: following ‘false’ branch (when ‘avgDistSortKey’ is non-NULL)... Pillow-12.1.0/src/libImaging/Quant.c:1633:10: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1633:10: call_function: calling ‘build_distance_tables’ from ‘quantize2’ Pillow-12.1.0/src/libImaging/Quant.c:1633:10: return_function: returning to ‘quantize2’ from ‘build_distance_tables’ Pillow-12.1.0/src/libImaging/Quant.c:1633:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Quant.c:1637:10: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1637:10: call_function: calling ‘map_image_pixels’ from ‘quantize2’ # 860| HashTable *h2; # 861| # 862|-> h2 = hashtable_new(unshifted_pixel_hash, unshifted_pixel_cmp); # 863| for (i = 0; i < nPixels; i++) { # 864| if (!hashtable_lookup(h2, pixelData[i], &bestmatch)) { Error: GCC_ANALYZER_WARNING (CWE-401): [#def83] Pillow-12.1.0/src/libImaging/Quant.c:862:10: warning[-Wanalyzer-malloc-leak]: leak of ‘p’ Pillow-12.1.0/src/libImaging/Quant.c:1566:1: enter_function: entry to ‘quantize2’ Pillow-12.1.0/src/libImaging/Quant.c:1586:9: acquire_memory: allocated here Pillow-12.1.0/src/libImaging/Quant.c:1587:8: branch_false: following ‘false’ branch (when ‘p’ is non-NULL)... Pillow-12.1.0/src/libImaging/Quant.c:1591:9: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1601:17: branch_false: following ‘false’ branch (when ‘i >= nQuantPixels’)... Pillow-12.1.0/src/libImaging/Quant.c:1609:5: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1613:8: branch_false: following ‘false’ branch (when ‘qp’ is non-NULL)... Pillow-12.1.0/src/libImaging/Quant.c:1613:8: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1617:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Quant.c:1622:22: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1623:8: branch_false: following ‘false’ branch (when ‘avgDist’ is non-NULL)... Pillow-12.1.0/src/libImaging/Quant.c:1628:22: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1629:8: branch_false: following ‘false’ branch (when ‘avgDistSortKey’ is non-NULL)... Pillow-12.1.0/src/libImaging/Quant.c:1633:10: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1633:10: call_function: calling ‘build_distance_tables’ from ‘quantize2’ Pillow-12.1.0/src/libImaging/Quant.c:1633:10: return_function: returning to ‘quantize2’ from ‘build_distance_tables’ Pillow-12.1.0/src/libImaging/Quant.c:1633:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Quant.c:1637:10: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1637:10: call_function: calling ‘map_image_pixels’ from ‘quantize2’ # 860| HashTable *h2; # 861| # 862|-> h2 = hashtable_new(unshifted_pixel_hash, unshifted_pixel_cmp); # 863| for (i = 0; i < nPixels; i++) { # 864| if (!hashtable_lookup(h2, pixelData[i], &bestmatch)) { Error: GCC_ANALYZER_WARNING (CWE-401): [#def84] Pillow-12.1.0/src/libImaging/Quant.c:862:10: warning[-Wanalyzer-malloc-leak]: leak of ‘qp’ Pillow-12.1.0/src/libImaging/Quant.c:1566:1: enter_function: entry to ‘quantize2’ Pillow-12.1.0/src/libImaging/Quant.c:1587:8: branch_false: following ‘false’ branch (when ‘p’ is non-NULL)... Pillow-12.1.0/src/libImaging/Quant.c:1591:9: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1601:17: branch_false: following ‘false’ branch (when ‘i >= nQuantPixels’)... Pillow-12.1.0/src/libImaging/Quant.c:1609:5: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1612:10: acquire_memory: allocated here Pillow-12.1.0/src/libImaging/Quant.c:1613:8: branch_false: following ‘false’ branch (when ‘qp’ is non-NULL)... Pillow-12.1.0/src/libImaging/Quant.c:1613:8: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1617:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Quant.c:1622:22: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1623:8: branch_false: following ‘false’ branch (when ‘avgDist’ is non-NULL)... Pillow-12.1.0/src/libImaging/Quant.c:1628:22: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1629:8: branch_false: following ‘false’ branch (when ‘avgDistSortKey’ is non-NULL)... Pillow-12.1.0/src/libImaging/Quant.c:1633:10: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1633:10: call_function: calling ‘build_distance_tables’ from ‘quantize2’ Pillow-12.1.0/src/libImaging/Quant.c:1633:10: return_function: returning to ‘quantize2’ from ‘build_distance_tables’ Pillow-12.1.0/src/libImaging/Quant.c:1633:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Quant.c:1637:10: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1637:10: call_function: calling ‘map_image_pixels’ from ‘quantize2’ # 860| HashTable *h2; # 861| # 862|-> h2 = hashtable_new(unshifted_pixel_hash, unshifted_pixel_cmp); # 863| for (i = 0; i < nPixels; i++) { # 864| if (!hashtable_lookup(h2, pixelData[i], &bestmatch)) { Error: GCC_ANALYZER_WARNING (CWE-401): [#def85] Pillow-12.1.0/src/libImaging/Quant.c:864:14: warning[-Wanalyzer-malloc-leak]: leak of ‘avgDistSortKey’ Pillow-12.1.0/src/libImaging/Quant.c:1566:1: enter_function: entry to ‘quantize2’ Pillow-12.1.0/src/libImaging/Quant.c:1587:8: branch_false: following ‘false’ branch (when ‘p’ is non-NULL)... Pillow-12.1.0/src/libImaging/Quant.c:1591:9: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1592:17: branch_true: following ‘true’ branch (when ‘i < nPixels’)... Pillow-12.1.0/src/libImaging/Quant.c:1593:38: branch_true: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1601:17: branch_false: following ‘false’ branch (when ‘i >= nQuantPixels’)... Pillow-12.1.0/src/libImaging/Quant.c:1609:5: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1613:8: branch_false: following ‘false’ branch (when ‘qp’ is non-NULL)... Pillow-12.1.0/src/libImaging/Quant.c:1613:8: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1617:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Quant.c:1622:22: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1623:8: branch_false: following ‘false’ branch (when ‘avgDist’ is non-NULL)... Pillow-12.1.0/src/libImaging/Quant.c:1628:22: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1628:22: acquire_memory: allocated here Pillow-12.1.0/src/libImaging/Quant.c:1629:8: branch_false: following ‘false’ branch (when ‘avgDistSortKey’ is non-NULL)... Pillow-12.1.0/src/libImaging/Quant.c:1633:10: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1633:10: call_function: calling ‘build_distance_tables’ from ‘quantize2’ Pillow-12.1.0/src/libImaging/Quant.c:1633:10: return_function: returning to ‘quantize2’ from ‘build_distance_tables’ Pillow-12.1.0/src/libImaging/Quant.c:1633:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Quant.c:1637:10: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1637:10: call_function: calling ‘map_image_pixels’ from ‘quantize2’ # 862| h2 = hashtable_new(unshifted_pixel_hash, unshifted_pixel_cmp); # 863| for (i = 0; i < nPixels; i++) { # 864|-> if (!hashtable_lookup(h2, pixelData[i], &bestmatch)) { # 865| bestmatch = 0; # 866| initialdist = _DISTSQR(paletteData + bestmatch, pixelData + i); Error: GCC_ANALYZER_WARNING (CWE-401): [#def86] Pillow-12.1.0/src/libImaging/Quant.c:864:14: warning[-Wanalyzer-malloc-leak]: leak of ‘avgDist’ Pillow-12.1.0/src/libImaging/Quant.c:1566:1: enter_function: entry to ‘quantize2’ Pillow-12.1.0/src/libImaging/Quant.c:1587:8: branch_false: following ‘false’ branch (when ‘p’ is non-NULL)... Pillow-12.1.0/src/libImaging/Quant.c:1591:9: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1592:17: branch_true: following ‘true’ branch (when ‘i < nPixels’)... Pillow-12.1.0/src/libImaging/Quant.c:1593:38: branch_true: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1601:17: branch_false: following ‘false’ branch (when ‘i >= nQuantPixels’)... Pillow-12.1.0/src/libImaging/Quant.c:1609:5: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1613:8: branch_false: following ‘false’ branch (when ‘qp’ is non-NULL)... Pillow-12.1.0/src/libImaging/Quant.c:1613:8: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1617:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Quant.c:1622:22: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1622:15: acquire_memory: allocated here Pillow-12.1.0/src/libImaging/Quant.c:1623:8: branch_false: following ‘false’ branch (when ‘avgDist’ is non-NULL)... Pillow-12.1.0/src/libImaging/Quant.c:1628:22: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1629:8: branch_false: following ‘false’ branch (when ‘avgDistSortKey’ is non-NULL)... Pillow-12.1.0/src/libImaging/Quant.c:1633:10: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1633:10: call_function: calling ‘build_distance_tables’ from ‘quantize2’ Pillow-12.1.0/src/libImaging/Quant.c:1633:10: return_function: returning to ‘quantize2’ from ‘build_distance_tables’ Pillow-12.1.0/src/libImaging/Quant.c:1633:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Quant.c:1637:10: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1637:10: call_function: calling ‘map_image_pixels’ from ‘quantize2’ # 862| h2 = hashtable_new(unshifted_pixel_hash, unshifted_pixel_cmp); # 863| for (i = 0; i < nPixels; i++) { # 864|-> if (!hashtable_lookup(h2, pixelData[i], &bestmatch)) { # 865| bestmatch = 0; # 866| initialdist = _DISTSQR(paletteData + bestmatch, pixelData + i); Error: GCC_ANALYZER_WARNING (CWE-401): [#def87] Pillow-12.1.0/src/libImaging/Quant.c:864:14: warning[-Wanalyzer-malloc-leak]: leak of ‘p’ Pillow-12.1.0/src/libImaging/Quant.c:1566:1: enter_function: entry to ‘quantize2’ Pillow-12.1.0/src/libImaging/Quant.c:1586:9: acquire_memory: allocated here Pillow-12.1.0/src/libImaging/Quant.c:1587:8: branch_false: following ‘false’ branch (when ‘p’ is non-NULL)... Pillow-12.1.0/src/libImaging/Quant.c:1591:9: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1592:17: branch_true: following ‘true’ branch (when ‘i < nPixels’)... Pillow-12.1.0/src/libImaging/Quant.c:1593:38: branch_true: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1601:17: branch_false: following ‘false’ branch (when ‘i >= nQuantPixels’)... Pillow-12.1.0/src/libImaging/Quant.c:1609:5: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1613:8: branch_false: following ‘false’ branch (when ‘qp’ is non-NULL)... Pillow-12.1.0/src/libImaging/Quant.c:1613:8: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1617:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Quant.c:1622:22: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1623:8: branch_false: following ‘false’ branch (when ‘avgDist’ is non-NULL)... Pillow-12.1.0/src/libImaging/Quant.c:1628:22: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1629:8: branch_false: following ‘false’ branch (when ‘avgDistSortKey’ is non-NULL)... Pillow-12.1.0/src/libImaging/Quant.c:1633:10: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1633:10: call_function: calling ‘build_distance_tables’ from ‘quantize2’ Pillow-12.1.0/src/libImaging/Quant.c:1633:10: return_function: returning to ‘quantize2’ from ‘build_distance_tables’ Pillow-12.1.0/src/libImaging/Quant.c:1633:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Quant.c:1637:10: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1637:10: call_function: calling ‘map_image_pixels’ from ‘quantize2’ # 862| h2 = hashtable_new(unshifted_pixel_hash, unshifted_pixel_cmp); # 863| for (i = 0; i < nPixels; i++) { # 864|-> if (!hashtable_lookup(h2, pixelData[i], &bestmatch)) { # 865| bestmatch = 0; # 866| initialdist = _DISTSQR(paletteData + bestmatch, pixelData + i); Error: GCC_ANALYZER_WARNING (CWE-401): [#def88] Pillow-12.1.0/src/libImaging/Quant.c:864:14: warning[-Wanalyzer-malloc-leak]: leak of ‘qp’ Pillow-12.1.0/src/libImaging/Quant.c:1566:1: enter_function: entry to ‘quantize2’ Pillow-12.1.0/src/libImaging/Quant.c:1587:8: branch_false: following ‘false’ branch (when ‘p’ is non-NULL)... Pillow-12.1.0/src/libImaging/Quant.c:1591:9: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1592:17: branch_true: following ‘true’ branch (when ‘i < nPixels’)... Pillow-12.1.0/src/libImaging/Quant.c:1593:38: branch_true: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1601:17: branch_false: following ‘false’ branch (when ‘i >= nQuantPixels’)... Pillow-12.1.0/src/libImaging/Quant.c:1609:5: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1612:10: acquire_memory: allocated here Pillow-12.1.0/src/libImaging/Quant.c:1613:8: branch_false: following ‘false’ branch (when ‘qp’ is non-NULL)... Pillow-12.1.0/src/libImaging/Quant.c:1613:8: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1617:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Quant.c:1622:22: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1623:8: branch_false: following ‘false’ branch (when ‘avgDist’ is non-NULL)... Pillow-12.1.0/src/libImaging/Quant.c:1628:22: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1629:8: branch_false: following ‘false’ branch (when ‘avgDistSortKey’ is non-NULL)... Pillow-12.1.0/src/libImaging/Quant.c:1633:10: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1633:10: call_function: calling ‘build_distance_tables’ from ‘quantize2’ Pillow-12.1.0/src/libImaging/Quant.c:1633:10: return_function: returning to ‘quantize2’ from ‘build_distance_tables’ Pillow-12.1.0/src/libImaging/Quant.c:1633:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Quant.c:1637:10: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1637:10: call_function: calling ‘map_image_pixels’ from ‘quantize2’ # 862| h2 = hashtable_new(unshifted_pixel_hash, unshifted_pixel_cmp); # 863| for (i = 0; i < nPixels; i++) { # 864|-> if (!hashtable_lookup(h2, pixelData[i], &bestmatch)) { # 865| bestmatch = 0; # 866| initialdist = _DISTSQR(paletteData + bestmatch, pixelData + i); Error: GCC_ANALYZER_WARNING (CWE-401): [#def89] Pillow-12.1.0/src/libImaging/Quant.c:887:5: warning[-Wanalyzer-malloc-leak]: leak of ‘avgDistSortKey’ Pillow-12.1.0/src/libImaging/Quant.c:1566:1: enter_function: entry to ‘quantize2’ Pillow-12.1.0/src/libImaging/Quant.c:1587:8: branch_false: following ‘false’ branch (when ‘p’ is non-NULL)... Pillow-12.1.0/src/libImaging/Quant.c:1591:9: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1601:17: branch_false: following ‘false’ branch (when ‘i >= nQuantPixels’)... Pillow-12.1.0/src/libImaging/Quant.c:1609:5: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1613:8: branch_false: following ‘false’ branch (when ‘qp’ is non-NULL)... Pillow-12.1.0/src/libImaging/Quant.c:1613:8: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1617:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Quant.c:1622:22: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1623:8: branch_false: following ‘false’ branch (when ‘avgDist’ is non-NULL)... Pillow-12.1.0/src/libImaging/Quant.c:1628:22: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1628:22: acquire_memory: allocated here Pillow-12.1.0/src/libImaging/Quant.c:1629:8: branch_false: following ‘false’ branch (when ‘avgDistSortKey’ is non-NULL)... Pillow-12.1.0/src/libImaging/Quant.c:1633:10: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1633:10: call_function: calling ‘build_distance_tables’ from ‘quantize2’ Pillow-12.1.0/src/libImaging/Quant.c:1633:10: return_function: returning to ‘quantize2’ from ‘build_distance_tables’ Pillow-12.1.0/src/libImaging/Quant.c:1633:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Quant.c:1637:10: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1637:10: call_function: calling ‘map_image_pixels’ from ‘quantize2’ # 885| pixelArray[i] = bestmatch; # 886| } # 887|-> hashtable_free(h2); # 888| return 1; # 889| } Error: GCC_ANALYZER_WARNING (CWE-401): [#def90] Pillow-12.1.0/src/libImaging/Quant.c:887:5: warning[-Wanalyzer-malloc-leak]: leak of ‘avgDist’ Pillow-12.1.0/src/libImaging/Quant.c:1566:1: enter_function: entry to ‘quantize2’ Pillow-12.1.0/src/libImaging/Quant.c:1587:8: branch_false: following ‘false’ branch (when ‘p’ is non-NULL)... Pillow-12.1.0/src/libImaging/Quant.c:1591:9: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1601:17: branch_false: following ‘false’ branch (when ‘i >= nQuantPixels’)... Pillow-12.1.0/src/libImaging/Quant.c:1609:5: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1613:8: branch_false: following ‘false’ branch (when ‘qp’ is non-NULL)... Pillow-12.1.0/src/libImaging/Quant.c:1613:8: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1617:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Quant.c:1622:22: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1622:15: acquire_memory: allocated here Pillow-12.1.0/src/libImaging/Quant.c:1623:8: branch_false: following ‘false’ branch (when ‘avgDist’ is non-NULL)... Pillow-12.1.0/src/libImaging/Quant.c:1628:22: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1629:8: branch_false: following ‘false’ branch (when ‘avgDistSortKey’ is non-NULL)... Pillow-12.1.0/src/libImaging/Quant.c:1633:10: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1633:10: call_function: calling ‘build_distance_tables’ from ‘quantize2’ Pillow-12.1.0/src/libImaging/Quant.c:1633:10: return_function: returning to ‘quantize2’ from ‘build_distance_tables’ Pillow-12.1.0/src/libImaging/Quant.c:1633:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Quant.c:1637:10: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1637:10: call_function: calling ‘map_image_pixels’ from ‘quantize2’ # 885| pixelArray[i] = bestmatch; # 886| } # 887|-> hashtable_free(h2); # 888| return 1; # 889| } Error: GCC_ANALYZER_WARNING (CWE-401): [#def91] Pillow-12.1.0/src/libImaging/Quant.c:887:5: warning[-Wanalyzer-malloc-leak]: leak of ‘p’ Pillow-12.1.0/src/libImaging/Quant.c:1566:1: enter_function: entry to ‘quantize2’ Pillow-12.1.0/src/libImaging/Quant.c:1586:9: acquire_memory: allocated here Pillow-12.1.0/src/libImaging/Quant.c:1587:8: branch_false: following ‘false’ branch (when ‘p’ is non-NULL)... Pillow-12.1.0/src/libImaging/Quant.c:1591:9: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1601:17: branch_false: following ‘false’ branch (when ‘i >= nQuantPixels’)... Pillow-12.1.0/src/libImaging/Quant.c:1609:5: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1613:8: branch_false: following ‘false’ branch (when ‘qp’ is non-NULL)... Pillow-12.1.0/src/libImaging/Quant.c:1613:8: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1617:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Quant.c:1622:22: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1623:8: branch_false: following ‘false’ branch (when ‘avgDist’ is non-NULL)... Pillow-12.1.0/src/libImaging/Quant.c:1628:22: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1629:8: branch_false: following ‘false’ branch (when ‘avgDistSortKey’ is non-NULL)... Pillow-12.1.0/src/libImaging/Quant.c:1633:10: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1633:10: call_function: calling ‘build_distance_tables’ from ‘quantize2’ Pillow-12.1.0/src/libImaging/Quant.c:1633:10: return_function: returning to ‘quantize2’ from ‘build_distance_tables’ Pillow-12.1.0/src/libImaging/Quant.c:1633:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Quant.c:1637:10: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1637:10: call_function: calling ‘map_image_pixels’ from ‘quantize2’ # 885| pixelArray[i] = bestmatch; # 886| } # 887|-> hashtable_free(h2); # 888| return 1; # 889| } Error: GCC_ANALYZER_WARNING (CWE-401): [#def92] Pillow-12.1.0/src/libImaging/Quant.c:887:5: warning[-Wanalyzer-malloc-leak]: leak of ‘qp’ Pillow-12.1.0/src/libImaging/Quant.c:1566:1: enter_function: entry to ‘quantize2’ Pillow-12.1.0/src/libImaging/Quant.c:1587:8: branch_false: following ‘false’ branch (when ‘p’ is non-NULL)... Pillow-12.1.0/src/libImaging/Quant.c:1591:9: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1601:17: branch_false: following ‘false’ branch (when ‘i >= nQuantPixels’)... Pillow-12.1.0/src/libImaging/Quant.c:1609:5: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1612:10: acquire_memory: allocated here Pillow-12.1.0/src/libImaging/Quant.c:1613:8: branch_false: following ‘false’ branch (when ‘qp’ is non-NULL)... Pillow-12.1.0/src/libImaging/Quant.c:1613:8: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1617:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Quant.c:1622:22: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1623:8: branch_false: following ‘false’ branch (when ‘avgDist’ is non-NULL)... Pillow-12.1.0/src/libImaging/Quant.c:1628:22: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1629:8: branch_false: following ‘false’ branch (when ‘avgDistSortKey’ is non-NULL)... Pillow-12.1.0/src/libImaging/Quant.c:1633:10: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1633:10: call_function: calling ‘build_distance_tables’ from ‘quantize2’ Pillow-12.1.0/src/libImaging/Quant.c:1633:10: return_function: returning to ‘quantize2’ from ‘build_distance_tables’ Pillow-12.1.0/src/libImaging/Quant.c:1633:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Quant.c:1637:10: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1637:10: call_function: calling ‘map_image_pixels’ from ‘quantize2’ # 885| pixelArray[i] = bestmatch; # 886| } # 887|-> hashtable_free(h2); # 888| return 1; # 889| } Error: GCC_ANALYZER_WARNING (CWE-401): [#def93] Pillow-12.1.0/src/libImaging/Quant.c:911:10: warning[-Wanalyzer-malloc-leak]: leak of ‘avgDistSortKey’ Pillow-12.1.0/src/libImaging/Quant.c:1159:1: enter_function: entry to ‘k_means’ Pillow-12.1.0/src/libImaging/Quant.c:1179:8: branch_false: following ‘false’ branch (when ‘count’ is non-NULL)... Pillow-12.1.0/src/libImaging/Quant.c:1179:8: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1182:17: branch_true: following ‘true’ branch (when ‘i != 3’)... Pillow-12.1.0/src/libImaging/Quant.c:1183:9: branch_true: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1185:17: branch_true: following ‘true’ branch (when ‘i != 3’)... Pillow-12.1.0/src/libImaging/Quant.c:1187:24: branch_true: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1187:12: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Quant.c:1185:24: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1185:17: branch_true: following ‘true’ branch (when ‘i != 3’)... Pillow-12.1.0/src/libImaging/Quant.c:1187:24: branch_true: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1187:12: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Quant.c:1185:24: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1185:17: branch_true: following ‘true’ branch (when ‘i != 3’)... Pillow-12.1.0/src/libImaging/Quant.c:1187:24: branch_true: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1187:12: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Quant.c:1185:24: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1185:17: branch_false: following ‘false’ branch (when ‘i == 3’)... Pillow-12.1.0/src/libImaging/Quant.c:1185:17: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1193:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Quant.c:1197:22: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1198:8: branch_false: following ‘false’ branch (when ‘avgDist’ is non-NULL)... Pillow-12.1.0/src/libImaging/Quant.c:1203:22: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1203:22: acquire_memory: allocated here Pillow-12.1.0/src/libImaging/Quant.c:1204:8: branch_false: following ‘false’ branch (when ‘avgDistSortKey’ is non-NULL)... Pillow-12.1.0/src/libImaging/Quant.c:1204:8: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1213:12: branch_true: following ‘true’ branch (when ‘built == 0’)... Pillow-12.1.0/src/libImaging/Quant.c:1214:13: branch_true: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1214:13: call_function: calling ‘compute_palette_from_quantized_pixels’ from ‘k_means’ Pillow-12.1.0/src/libImaging/Quant.c:1214:13: return_function: returning to ‘k_means’ from ‘compute_palette_from_quantized_pixels’ Pillow-12.1.0/src/libImaging/Quant.c:1217:18: call_function: calling ‘build_distance_tables’ from ‘k_means’ Pillow-12.1.0/src/libImaging/Quant.c:1217:18: return_function: returning to ‘k_means’ from ‘build_distance_tables’ Pillow-12.1.0/src/libImaging/Quant.c:1217:16: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Quant.c:1229:19: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1229:19: call_function: calling ‘map_image_pixels_from_quantized_pixels’ from ‘k_means’ # 909| int changes = 0; # 910| # 911|-> h2 = hashtable_new(unshifted_pixel_hash, unshifted_pixel_cmp); # 912| for (i = 0; i < nPixels; i++) { # 913| if (!hashtable_lookup(h2, pixelData[i], &bestmatch)) { Error: GCC_ANALYZER_WARNING (CWE-401): [#def94] Pillow-12.1.0/src/libImaging/Quant.c:911:10: warning[-Wanalyzer-malloc-leak]: leak of ‘count’ Pillow-12.1.0/src/libImaging/Quant.c:1159:1: enter_function: entry to ‘k_means’ Pillow-12.1.0/src/libImaging/Quant.c:1179:19: acquire_memory: allocated here Pillow-12.1.0/src/libImaging/Quant.c:1179:8: branch_false: following ‘false’ branch (when ‘count’ is non-NULL)... Pillow-12.1.0/src/libImaging/Quant.c:1179:8: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1182:17: branch_true: following ‘true’ branch (when ‘i != 3’)... Pillow-12.1.0/src/libImaging/Quant.c:1183:9: branch_true: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1185:17: branch_true: following ‘true’ branch (when ‘i != 3’)... Pillow-12.1.0/src/libImaging/Quant.c:1187:24: branch_true: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1187:12: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Quant.c:1185:24: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1185:17: branch_true: following ‘true’ branch (when ‘i != 3’)... Pillow-12.1.0/src/libImaging/Quant.c:1187:24: branch_true: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1187:12: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Quant.c:1185:24: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1185:17: branch_true: following ‘true’ branch (when ‘i != 3’)... Pillow-12.1.0/src/libImaging/Quant.c:1187:24: branch_true: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1187:12: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Quant.c:1185:24: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1185:17: branch_false: following ‘false’ branch (when ‘i == 3’)... Pillow-12.1.0/src/libImaging/Quant.c:1185:17: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1193:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Quant.c:1197:22: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1198:8: branch_false: following ‘false’ branch (when ‘avgDist’ is non-NULL)... Pillow-12.1.0/src/libImaging/Quant.c:1203:22: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1204:8: branch_false: following ‘false’ branch (when ‘avgDistSortKey’ is non-NULL)... Pillow-12.1.0/src/libImaging/Quant.c:1204:8: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1213:12: branch_true: following ‘true’ branch (when ‘built == 0’)... Pillow-12.1.0/src/libImaging/Quant.c:1214:13: branch_true: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1214:13: call_function: calling ‘compute_palette_from_quantized_pixels’ from ‘k_means’ Pillow-12.1.0/src/libImaging/Quant.c:1214:13: return_function: returning to ‘k_means’ from ‘compute_palette_from_quantized_pixels’ Pillow-12.1.0/src/libImaging/Quant.c:1217:18: call_function: calling ‘build_distance_tables’ from ‘k_means’ Pillow-12.1.0/src/libImaging/Quant.c:1217:18: return_function: returning to ‘k_means’ from ‘build_distance_tables’ Pillow-12.1.0/src/libImaging/Quant.c:1217:16: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Quant.c:1229:19: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1229:19: call_function: calling ‘map_image_pixels_from_quantized_pixels’ from ‘k_means’ # 909| int changes = 0; # 910| # 911|-> h2 = hashtable_new(unshifted_pixel_hash, unshifted_pixel_cmp); # 912| for (i = 0; i < nPixels; i++) { # 913| if (!hashtable_lookup(h2, pixelData[i], &bestmatch)) { Error: GCC_ANALYZER_WARNING (CWE-401): [#def95] Pillow-12.1.0/src/libImaging/Quant.c:913:14: warning[-Wanalyzer-malloc-leak]: leak of ‘avgDistSortKey’ Pillow-12.1.0/src/libImaging/Quant.c:1159:1: enter_function: entry to ‘k_means’ Pillow-12.1.0/src/libImaging/Quant.c:1179:8: branch_false: following ‘false’ branch (when ‘count’ is non-NULL)... Pillow-12.1.0/src/libImaging/Quant.c:1179:8: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1182:17: branch_true: following ‘true’ branch (when ‘i != 3’)... Pillow-12.1.0/src/libImaging/Quant.c:1183:9: branch_true: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1185:17: branch_true: following ‘true’ branch (when ‘i != 3’)... Pillow-12.1.0/src/libImaging/Quant.c:1187:24: branch_true: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1187:12: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Quant.c:1185:24: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1185:17: branch_true: following ‘true’ branch (when ‘i != 3’)... Pillow-12.1.0/src/libImaging/Quant.c:1187:24: branch_true: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1187:12: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Quant.c:1185:24: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1185:17: branch_true: following ‘true’ branch (when ‘i != 3’)... Pillow-12.1.0/src/libImaging/Quant.c:1187:24: branch_true: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1187:12: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Quant.c:1185:24: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1185:17: branch_false: following ‘false’ branch (when ‘i == 3’)... Pillow-12.1.0/src/libImaging/Quant.c:1185:17: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1193:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Quant.c:1197:22: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1198:8: branch_false: following ‘false’ branch (when ‘avgDist’ is non-NULL)... Pillow-12.1.0/src/libImaging/Quant.c:1203:22: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1203:22: acquire_memory: allocated here Pillow-12.1.0/src/libImaging/Quant.c:1204:8: branch_false: following ‘false’ branch (when ‘avgDistSortKey’ is non-NULL)... Pillow-12.1.0/src/libImaging/Quant.c:1204:8: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1213:12: branch_true: following ‘true’ branch (when ‘built == 0’)... Pillow-12.1.0/src/libImaging/Quant.c:1214:13: branch_true: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1214:13: call_function: calling ‘compute_palette_from_quantized_pixels’ from ‘k_means’ Pillow-12.1.0/src/libImaging/Quant.c:1214:13: return_function: returning to ‘k_means’ from ‘compute_palette_from_quantized_pixels’ Pillow-12.1.0/src/libImaging/Quant.c:1217:18: call_function: calling ‘build_distance_tables’ from ‘k_means’ Pillow-12.1.0/src/libImaging/Quant.c:1217:18: return_function: returning to ‘k_means’ from ‘build_distance_tables’ Pillow-12.1.0/src/libImaging/Quant.c:1217:16: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Quant.c:1229:19: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1229:19: call_function: calling ‘map_image_pixels_from_quantized_pixels’ from ‘k_means’ # 911| h2 = hashtable_new(unshifted_pixel_hash, unshifted_pixel_cmp); # 912| for (i = 0; i < nPixels; i++) { # 913|-> if (!hashtable_lookup(h2, pixelData[i], &bestmatch)) { # 914| bestmatch = pixelArray[i]; # 915| initialdist = _DISTSQR(paletteData + bestmatch, pixelData + i); Error: GCC_ANALYZER_WARNING (CWE-401): [#def96] Pillow-12.1.0/src/libImaging/Quant.c:913:14: warning[-Wanalyzer-malloc-leak]: leak of ‘count’ Pillow-12.1.0/src/libImaging/Quant.c:1159:1: enter_function: entry to ‘k_means’ Pillow-12.1.0/src/libImaging/Quant.c:1179:19: acquire_memory: allocated here Pillow-12.1.0/src/libImaging/Quant.c:1179:8: branch_false: following ‘false’ branch (when ‘count’ is non-NULL)... Pillow-12.1.0/src/libImaging/Quant.c:1179:8: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1182:17: branch_true: following ‘true’ branch (when ‘i != 3’)... Pillow-12.1.0/src/libImaging/Quant.c:1183:9: branch_true: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1185:17: branch_true: following ‘true’ branch (when ‘i != 3’)... Pillow-12.1.0/src/libImaging/Quant.c:1187:24: branch_true: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1187:12: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Quant.c:1185:24: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1185:17: branch_true: following ‘true’ branch (when ‘i != 3’)... Pillow-12.1.0/src/libImaging/Quant.c:1187:24: branch_true: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1187:12: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Quant.c:1185:24: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1185:17: branch_true: following ‘true’ branch (when ‘i != 3’)... Pillow-12.1.0/src/libImaging/Quant.c:1187:24: branch_true: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1187:12: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Quant.c:1185:24: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1185:17: branch_false: following ‘false’ branch (when ‘i == 3’)... Pillow-12.1.0/src/libImaging/Quant.c:1185:17: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1193:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Quant.c:1197:22: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1198:8: branch_false: following ‘false’ branch (when ‘avgDist’ is non-NULL)... Pillow-12.1.0/src/libImaging/Quant.c:1203:22: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1204:8: branch_false: following ‘false’ branch (when ‘avgDistSortKey’ is non-NULL)... Pillow-12.1.0/src/libImaging/Quant.c:1204:8: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1213:12: branch_true: following ‘true’ branch (when ‘built == 0’)... Pillow-12.1.0/src/libImaging/Quant.c:1214:13: branch_true: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1214:13: call_function: calling ‘compute_palette_from_quantized_pixels’ from ‘k_means’ Pillow-12.1.0/src/libImaging/Quant.c:1214:13: return_function: returning to ‘k_means’ from ‘compute_palette_from_quantized_pixels’ Pillow-12.1.0/src/libImaging/Quant.c:1217:18: call_function: calling ‘build_distance_tables’ from ‘k_means’ Pillow-12.1.0/src/libImaging/Quant.c:1217:18: return_function: returning to ‘k_means’ from ‘build_distance_tables’ Pillow-12.1.0/src/libImaging/Quant.c:1217:16: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Quant.c:1229:19: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1229:19: call_function: calling ‘map_image_pixels_from_quantized_pixels’ from ‘k_means’ # 911| h2 = hashtable_new(unshifted_pixel_hash, unshifted_pixel_cmp); # 912| for (i = 0; i < nPixels; i++) { # 913|-> if (!hashtable_lookup(h2, pixelData[i], &bestmatch)) { # 914| bestmatch = pixelArray[i]; # 915| initialdist = _DISTSQR(paletteData + bestmatch, pixelData + i); Error: GCC_ANALYZER_WARNING (CWE-401): [#def97] Pillow-12.1.0/src/libImaging/Quant.c:932:13: warning[-Wanalyzer-malloc-leak]: leak of ‘avgDistSortKey’ Pillow-12.1.0/src/libImaging/Quant.c:1159:1: enter_function: entry to ‘k_means’ Pillow-12.1.0/src/libImaging/Quant.c:1179:8: branch_false: following ‘false’ branch (when ‘count’ is non-NULL)... Pillow-12.1.0/src/libImaging/Quant.c:1179:8: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1182:17: branch_true: following ‘true’ branch (when ‘i != 3’)... Pillow-12.1.0/src/libImaging/Quant.c:1183:9: branch_true: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1185:17: branch_true: following ‘true’ branch (when ‘i != 3’)... Pillow-12.1.0/src/libImaging/Quant.c:1187:24: branch_true: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1187:12: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Quant.c:1185:24: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1185:17: branch_true: following ‘true’ branch (when ‘i != 3’)... Pillow-12.1.0/src/libImaging/Quant.c:1187:24: branch_true: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1187:12: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Quant.c:1185:24: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1185:17: branch_true: following ‘true’ branch (when ‘i != 3’)... Pillow-12.1.0/src/libImaging/Quant.c:1187:24: branch_true: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1187:12: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Quant.c:1185:24: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1185:17: branch_false: following ‘false’ branch (when ‘i == 3’)... Pillow-12.1.0/src/libImaging/Quant.c:1185:17: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1193:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Quant.c:1197:22: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1198:8: branch_false: following ‘false’ branch (when ‘avgDist’ is non-NULL)... Pillow-12.1.0/src/libImaging/Quant.c:1203:22: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1203:22: acquire_memory: allocated here Pillow-12.1.0/src/libImaging/Quant.c:1204:8: branch_false: following ‘false’ branch (when ‘avgDistSortKey’ is non-NULL)... Pillow-12.1.0/src/libImaging/Quant.c:1204:8: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1213:12: branch_true: following ‘true’ branch (when ‘built == 0’)... Pillow-12.1.0/src/libImaging/Quant.c:1214:13: branch_true: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1214:13: call_function: calling ‘compute_palette_from_quantized_pixels’ from ‘k_means’ Pillow-12.1.0/src/libImaging/Quant.c:1214:13: return_function: returning to ‘k_means’ from ‘compute_palette_from_quantized_pixels’ Pillow-12.1.0/src/libImaging/Quant.c:1217:18: call_function: calling ‘build_distance_tables’ from ‘k_means’ Pillow-12.1.0/src/libImaging/Quant.c:1217:18: return_function: returning to ‘k_means’ from ‘build_distance_tables’ Pillow-12.1.0/src/libImaging/Quant.c:1217:16: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Quant.c:1229:19: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1229:19: call_function: calling ‘map_image_pixels_from_quantized_pixels’ from ‘k_means’ # 930| } # 931| } # 932|-> hashtable_insert(h2, pixelData[i], bestmatch); # 933| } # 934| if (pixelArray[i] != bestmatch) { Error: GCC_ANALYZER_WARNING (CWE-401): [#def98] Pillow-12.1.0/src/libImaging/Quant.c:932:13: warning[-Wanalyzer-malloc-leak]: leak of ‘count’ Pillow-12.1.0/src/libImaging/Quant.c:1159:1: enter_function: entry to ‘k_means’ Pillow-12.1.0/src/libImaging/Quant.c:1179:19: acquire_memory: allocated here Pillow-12.1.0/src/libImaging/Quant.c:1179:8: branch_false: following ‘false’ branch (when ‘count’ is non-NULL)... Pillow-12.1.0/src/libImaging/Quant.c:1179:8: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1182:17: branch_true: following ‘true’ branch (when ‘i != 3’)... Pillow-12.1.0/src/libImaging/Quant.c:1183:9: branch_true: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1185:17: branch_true: following ‘true’ branch (when ‘i != 3’)... Pillow-12.1.0/src/libImaging/Quant.c:1187:24: branch_true: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1187:12: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Quant.c:1185:24: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1185:17: branch_true: following ‘true’ branch (when ‘i != 3’)... Pillow-12.1.0/src/libImaging/Quant.c:1187:24: branch_true: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1187:12: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Quant.c:1185:24: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1185:17: branch_true: following ‘true’ branch (when ‘i != 3’)... Pillow-12.1.0/src/libImaging/Quant.c:1187:24: branch_true: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1187:12: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Quant.c:1185:24: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1185:17: branch_false: following ‘false’ branch (when ‘i == 3’)... Pillow-12.1.0/src/libImaging/Quant.c:1185:17: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1193:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Quant.c:1197:22: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1198:8: branch_false: following ‘false’ branch (when ‘avgDist’ is non-NULL)... Pillow-12.1.0/src/libImaging/Quant.c:1203:22: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1204:8: branch_false: following ‘false’ branch (when ‘avgDistSortKey’ is non-NULL)... Pillow-12.1.0/src/libImaging/Quant.c:1204:8: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1213:12: branch_true: following ‘true’ branch (when ‘built == 0’)... Pillow-12.1.0/src/libImaging/Quant.c:1214:13: branch_true: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1214:13: call_function: calling ‘compute_palette_from_quantized_pixels’ from ‘k_means’ Pillow-12.1.0/src/libImaging/Quant.c:1214:13: return_function: returning to ‘k_means’ from ‘compute_palette_from_quantized_pixels’ Pillow-12.1.0/src/libImaging/Quant.c:1217:18: call_function: calling ‘build_distance_tables’ from ‘k_means’ Pillow-12.1.0/src/libImaging/Quant.c:1217:18: return_function: returning to ‘k_means’ from ‘build_distance_tables’ Pillow-12.1.0/src/libImaging/Quant.c:1217:16: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Quant.c:1229:19: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1229:19: call_function: calling ‘map_image_pixels_from_quantized_pixels’ from ‘k_means’ # 930| } # 931| } # 932|-> hashtable_insert(h2, pixelData[i], bestmatch); # 933| } # 934| if (pixelArray[i] != bestmatch) { Error: GCC_ANALYZER_WARNING (CWE-401): [#def99] Pillow-12.1.0/src/libImaging/Quant.c:947:5: warning[-Wanalyzer-malloc-leak]: leak of ‘avgDistSortKey’ Pillow-12.1.0/src/libImaging/Quant.c:1159:1: enter_function: entry to ‘k_means’ Pillow-12.1.0/src/libImaging/Quant.c:1179:8: branch_false: following ‘false’ branch (when ‘count’ is non-NULL)... Pillow-12.1.0/src/libImaging/Quant.c:1179:8: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1182:17: branch_true: following ‘true’ branch (when ‘i != 3’)... Pillow-12.1.0/src/libImaging/Quant.c:1183:9: branch_true: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1185:17: branch_true: following ‘true’ branch (when ‘i != 3’)... Pillow-12.1.0/src/libImaging/Quant.c:1187:24: branch_true: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1187:12: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Quant.c:1185:24: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1185:17: branch_true: following ‘true’ branch (when ‘i != 3’)... Pillow-12.1.0/src/libImaging/Quant.c:1187:24: branch_true: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1187:12: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Quant.c:1185:24: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1185:17: branch_true: following ‘true’ branch (when ‘i != 3’)... Pillow-12.1.0/src/libImaging/Quant.c:1187:24: branch_true: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1187:12: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Quant.c:1185:24: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1185:17: branch_false: following ‘false’ branch (when ‘i == 3’)... Pillow-12.1.0/src/libImaging/Quant.c:1185:17: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1193:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Quant.c:1197:22: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1198:8: branch_false: following ‘false’ branch (when ‘avgDist’ is non-NULL)... Pillow-12.1.0/src/libImaging/Quant.c:1203:22: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1203:22: acquire_memory: allocated here Pillow-12.1.0/src/libImaging/Quant.c:1204:8: branch_false: following ‘false’ branch (when ‘avgDistSortKey’ is non-NULL)... Pillow-12.1.0/src/libImaging/Quant.c:1204:8: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1213:12: branch_true: following ‘true’ branch (when ‘built == 0’)... Pillow-12.1.0/src/libImaging/Quant.c:1214:13: branch_true: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1214:13: call_function: calling ‘compute_palette_from_quantized_pixels’ from ‘k_means’ Pillow-12.1.0/src/libImaging/Quant.c:1214:13: return_function: returning to ‘k_means’ from ‘compute_palette_from_quantized_pixels’ Pillow-12.1.0/src/libImaging/Quant.c:1217:18: call_function: calling ‘build_distance_tables’ from ‘k_means’ Pillow-12.1.0/src/libImaging/Quant.c:1217:18: return_function: returning to ‘k_means’ from ‘build_distance_tables’ Pillow-12.1.0/src/libImaging/Quant.c:1217:16: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Quant.c:1229:19: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1229:19: call_function: calling ‘map_image_pixels_from_quantized_pixels’ from ‘k_means’ # 945| } # 946| } # 947|-> hashtable_free(h2); # 948| return changes; # 949| } Error: GCC_ANALYZER_WARNING (CWE-401): [#def100] Pillow-12.1.0/src/libImaging/Quant.c:947:5: warning[-Wanalyzer-malloc-leak]: leak of ‘count’ Pillow-12.1.0/src/libImaging/Quant.c:1159:1: enter_function: entry to ‘k_means’ Pillow-12.1.0/src/libImaging/Quant.c:1179:19: acquire_memory: allocated here Pillow-12.1.0/src/libImaging/Quant.c:1179:8: branch_false: following ‘false’ branch (when ‘count’ is non-NULL)... Pillow-12.1.0/src/libImaging/Quant.c:1179:8: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1182:17: branch_true: following ‘true’ branch (when ‘i != 3’)... Pillow-12.1.0/src/libImaging/Quant.c:1183:9: branch_true: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1185:17: branch_true: following ‘true’ branch (when ‘i != 3’)... Pillow-12.1.0/src/libImaging/Quant.c:1187:24: branch_true: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1187:12: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Quant.c:1185:24: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1185:17: branch_true: following ‘true’ branch (when ‘i != 3’)... Pillow-12.1.0/src/libImaging/Quant.c:1187:24: branch_true: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1187:12: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Quant.c:1185:24: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1185:17: branch_true: following ‘true’ branch (when ‘i != 3’)... Pillow-12.1.0/src/libImaging/Quant.c:1187:24: branch_true: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1187:12: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Quant.c:1185:24: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1185:17: branch_false: following ‘false’ branch (when ‘i == 3’)... Pillow-12.1.0/src/libImaging/Quant.c:1185:17: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1193:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Quant.c:1197:22: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1198:8: branch_false: following ‘false’ branch (when ‘avgDist’ is non-NULL)... Pillow-12.1.0/src/libImaging/Quant.c:1203:22: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1204:8: branch_false: following ‘false’ branch (when ‘avgDistSortKey’ is non-NULL)... Pillow-12.1.0/src/libImaging/Quant.c:1204:8: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1213:12: branch_true: following ‘true’ branch (when ‘built == 0’)... Pillow-12.1.0/src/libImaging/Quant.c:1214:13: branch_true: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1214:13: call_function: calling ‘compute_palette_from_quantized_pixels’ from ‘k_means’ Pillow-12.1.0/src/libImaging/Quant.c:1214:13: return_function: returning to ‘k_means’ from ‘compute_palette_from_quantized_pixels’ Pillow-12.1.0/src/libImaging/Quant.c:1217:18: call_function: calling ‘build_distance_tables’ from ‘k_means’ Pillow-12.1.0/src/libImaging/Quant.c:1217:18: return_function: returning to ‘k_means’ from ‘build_distance_tables’ Pillow-12.1.0/src/libImaging/Quant.c:1217:16: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Quant.c:1229:19: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1229:19: call_function: calling ‘map_image_pixels_from_quantized_pixels’ from ‘k_means’ # 945| } # 946| } # 947|-> hashtable_free(h2); # 948| return changes; # 949| } Error: GCC_ANALYZER_WARNING (CWE-401): [#def101] Pillow-12.1.0/src/libImaging/Quant.c:1335:5: warning[-Wanalyzer-malloc-leak]: leak of ‘p’ Pillow-12.1.0/src/libImaging/Quant.c:1665:1: enter_function: entry to ‘ImagingQuantize’ Pillow-12.1.0/src/libImaging/Quant.c:1678:8: branch_false: following ‘false’ branch (when ‘im’ is non-NULL)... Pillow-12.1.0/src/libImaging/Quant.c:1681:9: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1681:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Quant.c:1687:9: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1697:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Quant.c:1701:16: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1701:9: acquire_memory: allocated here Pillow-12.1.0/src/libImaging/Quant.c:1702:8: branch_false: following ‘false’ branch (when ‘p’ is non-NULL)... Pillow-12.1.0/src/libImaging/Quant.c:1711:8: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1779:22: call_function: calling ‘quantize’ from ‘ImagingQuantize’ # 1333| #endif # 1334| hl[0] = hl[1] = hl[2] = NULL; # 1335|-> hashtable_foreach(h, hash_to_list, hl); # 1336| #ifdef DEBUG # 1337| printf("done (%f)\n", (clock() - timer) / (double)CLOCKS_PER_SEC); Error: GCC_ANALYZER_WARNING (CWE-401): [#def102] Pillow-12.1.0/src/libImaging/Quant.c:1591:9: warning[-Wanalyzer-malloc-leak]: leak of ‘p’ Pillow-12.1.0/src/libImaging/Quant.c:1586:9: acquire_memory: allocated here Pillow-12.1.0/src/libImaging/Quant.c:1587:8: branch_false: following ‘false’ branch (when ‘p’ is non-NULL)... Pillow-12.1.0/src/libImaging/Quant.c:1591:9: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1591:9: throw: if ‘hashtable_new’ throws an exception... Pillow-12.1.0/src/libImaging/Quant.c:1591:9: danger: ‘p’ leaks here; was allocated at [(1)](sarif:/runs/0/results/36/codeFlows/0/threadFlows/0/locations/0) # 1589| } # 1590| mean[0] = mean[1] = mean[2] = 0; # 1591|-> h = hashtable_new(unshifted_pixel_hash, unshifted_pixel_cmp); # 1592| for (i = 0; i < nPixels; i++) { # 1593| hashtable_insert(h, pixelData[i], 0xffffffff); Error: GCC_ANALYZER_WARNING (CWE-401): [#def103] Pillow-12.1.0/src/libImaging/Quant.c:1593:9: warning[-Wanalyzer-malloc-leak]: leak of ‘p’ Pillow-12.1.0/src/libImaging/Quant.c:1586:9: acquire_memory: allocated here Pillow-12.1.0/src/libImaging/Quant.c:1587:8: branch_false: following ‘false’ branch (when ‘p’ is non-NULL)... Pillow-12.1.0/src/libImaging/Quant.c:1591:9: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1592:17: branch_true: following ‘true’ branch (when ‘i < nPixels’)... Pillow-12.1.0/src/libImaging/Quant.c:1593:38: branch_true: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1593:9: throw: if ‘hashtable_insert’ throws an exception... Pillow-12.1.0/src/libImaging/Quant.c:1593:9: danger: ‘p’ leaks here; was allocated at [(1)](sarif:/runs/0/results/38/codeFlows/0/threadFlows/0/locations/0) # 1591| h = hashtable_new(unshifted_pixel_hash, unshifted_pixel_cmp); # 1592| for (i = 0; i < nPixels; i++) { # 1593|-> hashtable_insert(h, pixelData[i], 0xffffffff); # 1594| mean[0] += pixelData[i].c.r; # 1595| mean[1] += pixelData[i].c.g; Error: GCC_ANALYZER_WARNING (CWE-401): [#def104] Pillow-12.1.0/src/libImaging/Quant.c:1605:9: warning[-Wanalyzer-malloc-leak]: leak of ‘p’ Pillow-12.1.0/src/libImaging/Quant.c:1586:9: acquire_memory: allocated here Pillow-12.1.0/src/libImaging/Quant.c:1587:8: branch_false: following ‘false’ branch (when ‘p’ is non-NULL)... Pillow-12.1.0/src/libImaging/Quant.c:1591:9: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1601:17: branch_true: following ‘true’ branch (when ‘i < nQuantPixels’)... Pillow-12.1.0/src/libImaging/Quant.c:1602:9: branch_true: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1605:9: throw: if ‘hashtable_foreach_update’ throws an exception... Pillow-12.1.0/src/libImaging/Quant.c:1605:9: danger: ‘p’ leaks here; was allocated at [(1)](sarif:/runs/0/results/40/codeFlows/0/threadFlows/0/locations/0) # 1603| data.furthestV = pixelData[0].v; # 1604| data.secondPixel = (i == 1) ? 1 : 0; # 1605|-> hashtable_foreach_update(h, compute_distances, &data); # 1606| p[i].v = data.furthestV; # 1607| data.new.v = data.furthestV; Error: GCC_ANALYZER_WARNING (CWE-401): [#def105] Pillow-12.1.0/src/libImaging/Quant.c:1609:5: warning[-Wanalyzer-malloc-leak]: leak of ‘p’ Pillow-12.1.0/src/libImaging/Quant.c:1586:9: acquire_memory: allocated here Pillow-12.1.0/src/libImaging/Quant.c:1587:8: branch_false: following ‘false’ branch (when ‘p’ is non-NULL)... Pillow-12.1.0/src/libImaging/Quant.c:1591:9: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1601:17: branch_false: following ‘false’ branch (when ‘i >= nQuantPixels’)... Pillow-12.1.0/src/libImaging/Quant.c:1609:5: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1609:5: throw: if ‘hashtable_free’ throws an exception... Pillow-12.1.0/src/libImaging/Quant.c:1609:5: danger: ‘p’ leaks here; was allocated at [(1)](sarif:/runs/0/results/42/codeFlows/0/threadFlows/0/locations/0) # 1607| data.new.v = data.furthestV; # 1608| } # 1609|-> hashtable_free(h); # 1610| # 1611| /* malloc check ok, using calloc */ Error: GCC_ANALYZER_WARNING (CWE-401): [#def106] Pillow-12.1.0/src/libImaging/Quant.c:1774:5: warning[-Wanalyzer-malloc-leak]: leak of ‘p’ Pillow-12.1.0/src/libImaging/Quant.c:1678:8: branch_false: following ‘false’ branch (when ‘im’ is non-NULL)... Pillow-12.1.0/src/libImaging/Quant.c:1681:9: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1681:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Quant.c:1687:9: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1697:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Quant.c:1701:16: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1701:9: acquire_memory: allocated here Pillow-12.1.0/src/libImaging/Quant.c:1702:8: branch_false: following ‘false’ branch (when ‘p’ is non-NULL)... Pillow-12.1.0/src/libImaging/Quant.c:1711:8: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1711:8: branch_true: following ‘true’ branch... Pillow-12.1.0/src/libImaging/Quant.c:1711:8: branch_true: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1774:5: throw: if ‘ImagingSectionEnter’ throws an exception... Pillow-12.1.0/src/libImaging/Quant.c:1774:5: danger: ‘p’ leaks here; was allocated at [(7)](sarif:/runs/0/results/44/codeFlows/0/threadFlows/0/locations/6) # 1772| } # 1773| # 1774|-> ImagingSectionEnter(&cookie); # 1775| # 1776| switch (mode) { Error: GCC_ANALYZER_WARNING (CWE-401): [#def107] Pillow-12.1.0/src/libImaging/Quant.c:1802:22: warning[-Wanalyzer-malloc-leak]: leak of ‘p’ Pillow-12.1.0/src/libImaging/Quant.c:1678:8: branch_false: following ‘false’ branch (when ‘im’ is non-NULL)... Pillow-12.1.0/src/libImaging/Quant.c:1681:9: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1681:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Quant.c:1687:9: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1697:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Quant.c:1701:16: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1701:9: acquire_memory: allocated here Pillow-12.1.0/src/libImaging/Quant.c:1702:8: branch_false: following ‘false’ branch (when ‘p’ is non-NULL)... Pillow-12.1.0/src/libImaging/Quant.c:1711:8: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1802:22: throw: if ‘quantize_octree’ throws an exception... Pillow-12.1.0/src/libImaging/Quant.c:1802:22: danger: ‘p’ leaks here; was allocated at [(7)](sarif:/runs/0/results/45/codeFlows/0/threadFlows/0/locations/6) # 1800| break; # 1801| case 2: # 1802|-> result = quantize_octree( # 1803| p, # 1804| im->xsize * im->ysize, Error: GCC_ANALYZER_WARNING (CWE-401): [#def108] Pillow-12.1.0/src/libImaging/Quant.c:1814:22: warning[-Wanalyzer-malloc-leak]: leak of ‘p’ Pillow-12.1.0/src/libImaging/Quant.c:1678:8: branch_false: following ‘false’ branch (when ‘im’ is non-NULL)... Pillow-12.1.0/src/libImaging/Quant.c:1681:9: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1681:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Quant.c:1687:9: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1697:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Quant.c:1701:16: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1701:9: acquire_memory: allocated here Pillow-12.1.0/src/libImaging/Quant.c:1702:8: branch_false: following ‘false’ branch (when ‘p’ is non-NULL)... Pillow-12.1.0/src/libImaging/Quant.c:1711:8: branch_false: ...to here Pillow-12.1.0/src/libImaging/Quant.c:1814:22: throw: if ‘quantize_pngquant’ throws an exception... Pillow-12.1.0/src/libImaging/Quant.c:1814:22: danger: ‘p’ leaks here; was allocated at [(7)](sarif:/runs/0/results/46/codeFlows/0/threadFlows/0/locations/6) # 1812| case 3: # 1813| #ifdef HAVE_LIBIMAGEQUANT # 1814|-> result = quantize_pngquant( # 1815| p, # 1816| im->xsize, Error: GCC_ANALYZER_WARNING (CWE-401): [#def109] Pillow-12.1.0/src/libImaging/QuantPngQuant.c:91:19: warning[-Wanalyzer-malloc-leak]: leak of ‘charMatrixRows’ Pillow-12.1.0/src/libImaging/QuantPngQuant.c:44:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/QuantPngQuant.c:47:8: branch_false: ...to here Pillow-12.1.0/src/libImaging/QuantPngQuant.c:53:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/QuantPngQuant.c:58:13: branch_false: ...to here Pillow-12.1.0/src/libImaging/QuantPngQuant.c:59:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/QuantPngQuant.c:62:5: branch_false: ...to here Pillow-12.1.0/src/libImaging/QuantPngQuant.c:69:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/QuantPngQuant.c:69:8: branch_false: ...to here Pillow-12.1.0/src/libImaging/QuantPngQuant.c:81:8: branch_false: following ‘false’ branch (when ‘charMatrix’ is non-NULL)... Pillow-12.1.0/src/libImaging/QuantPngQuant.c:84:22: branch_false: ...to here Pillow-12.1.0/src/libImaging/QuantPngQuant.c:84:22: acquire_memory: allocated here Pillow-12.1.0/src/libImaging/QuantPngQuant.c:85:8: branch_false: following ‘false’ branch (when ‘charMatrixRows’ is non-NULL)... Pillow-12.1.0/src/libImaging/QuantPngQuant.c:85:8: branch_false: ...to here Pillow-12.1.0/src/libImaging/QuantPngQuant.c:91:19: throw: if ‘liq_write_remapped_image_rows’ throws an exception... Pillow-12.1.0/src/libImaging/QuantPngQuant.c:91:19: danger: ‘charMatrixRows’ leaks here; was allocated at [(11)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/10) # 89| charMatrixRows[y] = &charMatrix[y * width]; # 90| } # 91|-> if (LIQ_OK != liq_write_remapped_image_rows(remap, image, charMatrixRows)) { # 92| goto err; # 93| } Error: GCC_ANALYZER_WARNING (CWE-457): [#def110] Pillow-12.1.0/src/libImaging/RankFilter.c:60:1: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘*<unknown>’ Pillow-12.1.0/src/libImaging/RankFilter.c:62:13: enter_function: entry to ‘ImagingRankFilter’ Pillow-12.1.0/src/libImaging/RankFilter.c:67:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/RankFilter.c:71:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/RankFilter.c:76:16: branch_false: ...to here Pillow-12.1.0/src/libImaging/RankFilter.c:76:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/RankFilter.c:83:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/RankFilter.c:87:58: branch_false: ...to here Pillow-12.1.0/src/libImaging/RankFilter.c:88:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/RankFilter.c:114:9: branch_false: ...to here Pillow-12.1.0/src/libImaging/RankFilter.c:114:8: branch_true: following ‘true’ branch... Pillow-12.1.0/src/libImaging/RankFilter.c:115:9: branch_true: ...to here Pillow-12.1.0/src/libImaging/RankFilter.c:115:9: branch_false: following ‘false’ branch (when ‘buf’ is non-NULL)... Pillow-12.1.0/src/libImaging/RankFilter.c:115:9: branch_false: ...to here Pillow-12.1.0/src/libImaging/RankFilter.c:115:9: branch_true: following ‘true’ branch... Pillow-12.1.0/src/libImaging/RankFilter.c:115:9: branch_true: ...to here Pillow-12.1.0/src/libImaging/RankFilter.c:115:9: branch_false: following ‘false’ branch (when ‘i >= size’)... Pillow-12.1.0/src/libImaging/RankFilter.c:115:9: branch_false: ...to here Pillow-12.1.0/src/libImaging/RankFilter.c:115:9: call_function: calling ‘RankUINT8’ from ‘ImagingRankFilter’ # 58| } # 59| # 60|-> MakeRankFunction(UINT8) MakeRankFunction(INT32) MakeRankFunction(FLOAT32) # 61| # 62| Imaging ImagingRankFilter(Imaging im, int size, int rank) { Error: GCC_ANALYZER_WARNING (CWE-457): [#def111] Pillow-12.1.0/src/libImaging/RankFilter.c:60:25: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘*<unknown>’ Pillow-12.1.0/src/libImaging/RankFilter.c:62:13: enter_function: entry to ‘ImagingRankFilter’ Pillow-12.1.0/src/libImaging/RankFilter.c:67:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/RankFilter.c:71:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/RankFilter.c:76:16: branch_false: ...to here Pillow-12.1.0/src/libImaging/RankFilter.c:76:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/RankFilter.c:83:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/RankFilter.c:87:58: branch_false: ...to here Pillow-12.1.0/src/libImaging/RankFilter.c:88:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/RankFilter.c:114:9: branch_false: ...to here Pillow-12.1.0/src/libImaging/RankFilter.c:114:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/RankFilter.c:116:16: branch_false: ...to here Pillow-12.1.0/src/libImaging/RankFilter.c:116:15: branch_true: following ‘true’ branch... Pillow-12.1.0/src/libImaging/RankFilter.c:117:9: branch_true: ...to here Pillow-12.1.0/src/libImaging/RankFilter.c:117:9: branch_false: following ‘false’ branch (when ‘buf’ is non-NULL)... Pillow-12.1.0/src/libImaging/RankFilter.c:117:9: branch_false: ...to here Pillow-12.1.0/src/libImaging/RankFilter.c:117:9: branch_true: following ‘true’ branch... Pillow-12.1.0/src/libImaging/RankFilter.c:117:9: branch_true: ...to here Pillow-12.1.0/src/libImaging/RankFilter.c:117:9: branch_false: following ‘false’ branch (when ‘i >= size’)... Pillow-12.1.0/src/libImaging/RankFilter.c:117:9: branch_false: ...to here Pillow-12.1.0/src/libImaging/RankFilter.c:117:9: call_function: calling ‘RankINT32’ from ‘ImagingRankFilter’ # 58| } # 59| # 60|-> MakeRankFunction(UINT8) MakeRankFunction(INT32) MakeRankFunction(FLOAT32) # 61| # 62| Imaging ImagingRankFilter(Imaging im, int size, int rank) { Error: GCC_ANALYZER_WARNING (CWE-457): [#def112] Pillow-12.1.0/src/libImaging/RankFilter.c:60:49: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘*<unknown>’ Pillow-12.1.0/src/libImaging/RankFilter.c:62:13: enter_function: entry to ‘ImagingRankFilter’ Pillow-12.1.0/src/libImaging/RankFilter.c:67:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/RankFilter.c:71:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/RankFilter.c:76:16: branch_false: ...to here Pillow-12.1.0/src/libImaging/RankFilter.c:76:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/RankFilter.c:83:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/RankFilter.c:87:58: branch_false: ...to here Pillow-12.1.0/src/libImaging/RankFilter.c:88:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/RankFilter.c:114:9: branch_false: ...to here Pillow-12.1.0/src/libImaging/RankFilter.c:114:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/RankFilter.c:116:16: branch_false: ...to here Pillow-12.1.0/src/libImaging/RankFilter.c:116:15: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/RankFilter.c:118:15: branch_false: ...to here Pillow-12.1.0/src/libImaging/RankFilter.c:118:15: branch_true: following ‘true’ branch... Pillow-12.1.0/src/libImaging/RankFilter.c:119:9: branch_true: ...to here Pillow-12.1.0/src/libImaging/RankFilter.c:119:9: branch_false: following ‘false’ branch (when ‘buf’ is non-NULL)... Pillow-12.1.0/src/libImaging/RankFilter.c:119:9: branch_false: ...to here Pillow-12.1.0/src/libImaging/RankFilter.c:119:9: branch_true: following ‘true’ branch... Pillow-12.1.0/src/libImaging/RankFilter.c:119:9: branch_true: ...to here Pillow-12.1.0/src/libImaging/RankFilter.c:119:9: branch_false: following ‘false’ branch (when ‘i >= size’)... Pillow-12.1.0/src/libImaging/RankFilter.c:119:9: branch_false: ...to here Pillow-12.1.0/src/libImaging/RankFilter.c:119:9: call_function: calling ‘RankFLOAT32’ from ‘ImagingRankFilter’ # 58| } # 59| # 60|-> MakeRankFunction(UINT8) MakeRankFunction(INT32) MakeRankFunction(FLOAT32) # 61| # 62| Imaging ImagingRankFilter(Imaging im, int size, int rank) { Error: GCC_ANALYZER_WARNING (CWE-401): [#def113] Pillow-12.1.0/src/libImaging/Resample.c:211:9: warning[-Wanalyzer-malloc-leak]: leak of ‘bounds_horiz’ Pillow-12.1.0/src/libImaging/Resample.c:708:1: enter_function: entry to ‘ImagingResampleInner’ Pillow-12.1.0/src/libImaging/Resample.c:729:19: call_function: calling ‘precompute_coeffs’ from ‘ImagingResampleInner’ Pillow-12.1.0/src/libImaging/Resample.c:729:19: return_function: returning to ‘ImagingResampleInner’ from ‘precompute_coeffs’ Pillow-12.1.0/src/libImaging/Resample.c:732:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Resample.c:736:18: branch_false: ...to here Pillow-12.1.0/src/libImaging/Resample.c:736:18: call_function: calling ‘precompute_coeffs’ from ‘ImagingResampleInner’ # 209| // check for overflow # 210| if (outSize > INT_MAX / (ksize * (int)sizeof(double))) { # 211|-> ImagingError_MemoryError(); # 212| return 0; # 213| } Error: GCC_ANALYZER_WARNING: [#def114] Pillow-12.1.0/src/libImaging/Resample.c:217:10: warning[-Wanalyzer-imprecise-fp-arithmetic]: use of floating-point arithmetic here might yield unexpected results Pillow-12.1.0/src/libImaging/Resample.c:708:1: enter_function: entry to ‘ImagingResampleInner’ Pillow-12.1.0/src/libImaging/Resample.c:729:19: call_function: calling ‘precompute_coeffs’ from ‘ImagingResampleInner’ # 215| /* coefficient buffer */ # 216| /* malloc check ok, overflow checked above */ # 217|-> kk = malloc(outSize * ksize * sizeof(double)); # 218| if (!kk) { # 219| ImagingError_MemoryError(); Error: GCC_ANALYZER_WARNING (CWE-401): [#def115] Pillow-12.1.0/src/libImaging/Resample.c:219:9: warning[-Wanalyzer-malloc-leak]: leak of ‘bounds_horiz’ Pillow-12.1.0/src/libImaging/Resample.c:708:1: enter_function: entry to ‘ImagingResampleInner’ Pillow-12.1.0/src/libImaging/Resample.c:729:19: call_function: calling ‘precompute_coeffs’ from ‘ImagingResampleInner’ Pillow-12.1.0/src/libImaging/Resample.c:729:19: return_function: returning to ‘ImagingResampleInner’ from ‘precompute_coeffs’ Pillow-12.1.0/src/libImaging/Resample.c:732:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Resample.c:736:18: branch_false: ...to here Pillow-12.1.0/src/libImaging/Resample.c:736:18: call_function: calling ‘precompute_coeffs’ from ‘ImagingResampleInner’ # 217| kk = malloc(outSize * ksize * sizeof(double)); # 218| if (!kk) { # 219|-> ImagingError_MemoryError(); # 220| return 0; # 221| } Error: GCC_ANALYZER_WARNING (CWE-401): [#def116] Pillow-12.1.0/src/libImaging/Resample.c:227:9: warning[-Wanalyzer-malloc-leak]: leak of ‘bounds_horiz’ Pillow-12.1.0/src/libImaging/Resample.c:708:1: enter_function: entry to ‘ImagingResampleInner’ Pillow-12.1.0/src/libImaging/Resample.c:729:19: call_function: calling ‘precompute_coeffs’ from ‘ImagingResampleInner’ Pillow-12.1.0/src/libImaging/Resample.c:729:19: return_function: returning to ‘ImagingResampleInner’ from ‘precompute_coeffs’ Pillow-12.1.0/src/libImaging/Resample.c:732:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Resample.c:736:18: branch_false: ...to here Pillow-12.1.0/src/libImaging/Resample.c:736:18: call_function: calling ‘precompute_coeffs’ from ‘ImagingResampleInner’ # 225| if (!bounds) { # 226| free(kk); # 227|-> ImagingError_MemoryError(); # 228| return 0; # 229| } Error: GCC_ANALYZER_WARNING (CWE-401): [#def117] Pillow-12.1.0/src/libImaging/Resample.c:248:24: warning[-Wanalyzer-malloc-leak]: leak of ‘bounds_horiz’ Pillow-12.1.0/src/libImaging/Resample.c:708:1: enter_function: entry to ‘ImagingResampleInner’ Pillow-12.1.0/src/libImaging/Resample.c:729:19: call_function: calling ‘precompute_coeffs’ from ‘ImagingResampleInner’ Pillow-12.1.0/src/libImaging/Resample.c:729:19: return_function: returning to ‘ImagingResampleInner’ from ‘precompute_coeffs’ Pillow-12.1.0/src/libImaging/Resample.c:732:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Resample.c:736:18: branch_false: ...to here Pillow-12.1.0/src/libImaging/Resample.c:736:18: call_function: calling ‘precompute_coeffs’ from ‘ImagingResampleInner’ # 246| k = &kk[xx * ksize]; # 247| for (x = 0; x < xmax; x++) { # 248|-> double w = filterp->filter((x + xmin - center + 0.5) * ss); # 249| k[x] = w; # 250| ww += w; Error: GCC_ANALYZER_WARNING (CWE-401): [#def118] Pillow-12.1.0/src/libImaging/Resample.c:248:24: warning[-Wanalyzer-malloc-leak]: leak of ‘bounds’ Pillow-12.1.0/src/libImaging/Resample.c:708:1: enter_function: entry to ‘ImagingResampleInner’ Pillow-12.1.0/src/libImaging/Resample.c:729:19: call_function: calling ‘precompute_coeffs’ from ‘ImagingResampleInner’ # 246| k = &kk[xx * ksize]; # 247| for (x = 0; x < xmax; x++) { # 248|-> double w = filterp->filter((x + xmin - center + 0.5) * ss); # 249| k[x] = w; # 250| ww += w; Error: GCC_ANALYZER_WARNING (CWE-401): [#def119] Pillow-12.1.0/src/libImaging/Resample.c:248:24: warning[-Wanalyzer-malloc-leak]: leak of ‘kk’ Pillow-12.1.0/src/libImaging/Resample.c:708:1: enter_function: entry to ‘ImagingResampleInner’ Pillow-12.1.0/src/libImaging/Resample.c:729:19: call_function: calling ‘precompute_coeffs’ from ‘ImagingResampleInner’ # 246| k = &kk[xx * ksize]; # 247| for (x = 0; x < xmax; x++) { # 248|-> double w = filterp->filter((x + xmin - center + 0.5) * ss); # 249| k[x] = w; # 250| ww += w; Error: GCC_ANALYZER_WARNING (CWE-401): [#def120] Pillow-12.1.0/src/libImaging/Resample.c:482:5: warning[-Wanalyzer-malloc-leak]: leak of ‘bounds_horiz’ Pillow-12.1.0/src/libImaging/Resample.c:646:1: enter_function: entry to ‘ImagingResample’ Pillow-12.1.0/src/libImaging/Resample.c:651:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Resample.c:655:9: branch_false: ...to here Pillow-12.1.0/src/libImaging/Resample.c:655:8: branch_true: following ‘true’ branch... Pillow-12.1.0/src/libImaging/Resample.c:656:13: branch_true: ...to here Pillow-12.1.0/src/libImaging/Resample.c:656:12: branch_true: following ‘true’ branch... Pillow-12.1.0/src/libImaging/Resample.c:682:5: branch_true: ...to here Pillow-12.1.0/src/libImaging/Resample.c:702:12: call_function: calling ‘ImagingResampleInner’ from ‘ImagingResample’ # 480| } # 481| # 482|-> ImagingSectionEnter(&cookie); # 483| for (yy = 0; yy < imOut->ysize; yy++) { # 484| for (xx = 0; xx < imOut->xsize; xx++) { Error: GCC_ANALYZER_WARNING (CWE-401): [#def121] Pillow-12.1.0/src/libImaging/Resample.c:482:5: warning[-Wanalyzer-malloc-leak]: leak of ‘bounds_vert’ Pillow-12.1.0/src/libImaging/Resample.c:646:1: enter_function: entry to ‘ImagingResample’ Pillow-12.1.0/src/libImaging/Resample.c:651:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Resample.c:655:9: branch_false: ...to here Pillow-12.1.0/src/libImaging/Resample.c:655:8: branch_true: following ‘true’ branch... Pillow-12.1.0/src/libImaging/Resample.c:656:13: branch_true: ...to here Pillow-12.1.0/src/libImaging/Resample.c:656:12: branch_true: following ‘true’ branch... Pillow-12.1.0/src/libImaging/Resample.c:682:5: branch_true: ...to here Pillow-12.1.0/src/libImaging/Resample.c:702:12: call_function: calling ‘ImagingResampleInner’ from ‘ImagingResample’ # 480| } # 481| # 482|-> ImagingSectionEnter(&cookie); # 483| for (yy = 0; yy < imOut->ysize; yy++) { # 484| for (xx = 0; xx < imOut->xsize; xx++) { Error: GCC_ANALYZER_WARNING (CWE-401): [#def122] Pillow-12.1.0/src/libImaging/Resample.c:500:5: warning[-Wanalyzer-malloc-leak]: leak of ‘bounds_horiz’ Pillow-12.1.0/src/libImaging/Resample.c:646:1: enter_function: entry to ‘ImagingResample’ Pillow-12.1.0/src/libImaging/Resample.c:651:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Resample.c:655:9: branch_false: ...to here Pillow-12.1.0/src/libImaging/Resample.c:655:8: branch_true: following ‘true’ branch... Pillow-12.1.0/src/libImaging/Resample.c:656:13: branch_true: ...to here Pillow-12.1.0/src/libImaging/Resample.c:656:12: branch_true: following ‘true’ branch... Pillow-12.1.0/src/libImaging/Resample.c:682:5: branch_true: ...to here Pillow-12.1.0/src/libImaging/Resample.c:702:12: call_function: calling ‘ImagingResampleInner’ from ‘ImagingResample’ # 498| } # 499| } # 500|-> ImagingSectionLeave(&cookie); # 501| } # 502| Error: GCC_ANALYZER_WARNING (CWE-401): [#def123] Pillow-12.1.0/src/libImaging/Resample.c:500:5: warning[-Wanalyzer-malloc-leak]: leak of ‘bounds_vert’ Pillow-12.1.0/src/libImaging/Resample.c:646:1: enter_function: entry to ‘ImagingResample’ Pillow-12.1.0/src/libImaging/Resample.c:651:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Resample.c:655:9: branch_false: ...to here Pillow-12.1.0/src/libImaging/Resample.c:655:8: branch_true: following ‘true’ branch... Pillow-12.1.0/src/libImaging/Resample.c:656:13: branch_true: ...to here Pillow-12.1.0/src/libImaging/Resample.c:656:12: branch_true: following ‘true’ branch... Pillow-12.1.0/src/libImaging/Resample.c:682:5: branch_true: ...to here Pillow-12.1.0/src/libImaging/Resample.c:702:12: call_function: calling ‘ImagingResampleInner’ from ‘ImagingResample’ # 498| } # 499| } # 500|-> ImagingSectionLeave(&cookie); # 501| } # 502| Error: GCC_ANALYZER_WARNING (CWE-401): [#def124] Pillow-12.1.0/src/libImaging/Resample.c:522:5: warning[-Wanalyzer-malloc-leak]: leak of ‘bounds_vert’ Pillow-12.1.0/src/libImaging/Resample.c:646:1: enter_function: entry to ‘ImagingResample’ Pillow-12.1.0/src/libImaging/Resample.c:651:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Resample.c:655:9: branch_false: ...to here Pillow-12.1.0/src/libImaging/Resample.c:655:8: branch_true: following ‘true’ branch... Pillow-12.1.0/src/libImaging/Resample.c:656:13: branch_true: ...to here Pillow-12.1.0/src/libImaging/Resample.c:656:12: branch_true: following ‘true’ branch... Pillow-12.1.0/src/libImaging/Resample.c:682:5: branch_true: ...to here Pillow-12.1.0/src/libImaging/Resample.c:702:12: call_function: calling ‘ImagingResampleInner’ from ‘ImagingResample’ # 520| } # 521| # 522|-> ImagingSectionEnter(&cookie); # 523| for (yy = 0; yy < imOut->ysize; yy++) { # 524| ymin = bounds[yy * 2 + 0]; Error: GCC_ANALYZER_WARNING (CWE-401): [#def125] Pillow-12.1.0/src/libImaging/Resample.c:539:5: warning[-Wanalyzer-malloc-leak]: leak of ‘bounds_vert’ Pillow-12.1.0/src/libImaging/Resample.c:646:1: enter_function: entry to ‘ImagingResample’ Pillow-12.1.0/src/libImaging/Resample.c:651:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Resample.c:655:9: branch_false: ...to here Pillow-12.1.0/src/libImaging/Resample.c:655:8: branch_true: following ‘true’ branch... Pillow-12.1.0/src/libImaging/Resample.c:656:13: branch_true: ...to here Pillow-12.1.0/src/libImaging/Resample.c:656:12: branch_true: following ‘true’ branch... Pillow-12.1.0/src/libImaging/Resample.c:682:5: branch_true: ...to here Pillow-12.1.0/src/libImaging/Resample.c:702:12: call_function: calling ‘ImagingResampleInner’ from ‘ImagingResample’ # 537| } # 538| } # 539|-> ImagingSectionLeave(&cookie); # 540| } # 541| Error: GCC_ANALYZER_WARNING (CWE-401): [#def126] Pillow-12.1.0/src/libImaging/Resample.c:757:18: warning[-Wanalyzer-malloc-leak]: leak of ‘bounds_horiz’ Pillow-12.1.0/src/libImaging/Resample.c:708:1: enter_function: entry to ‘ImagingResampleInner’ Pillow-12.1.0/src/libImaging/Resample.c:729:19: call_function: calling ‘precompute_coeffs’ from ‘ImagingResampleInner’ Pillow-12.1.0/src/libImaging/Resample.c:729:19: return_function: returning to ‘ImagingResampleInner’ from ‘precompute_coeffs’ Pillow-12.1.0/src/libImaging/Resample.c:732:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Resample.c:736:18: branch_false: ...to here Pillow-12.1.0/src/libImaging/Resample.c:736:18: call_function: calling ‘precompute_coeffs’ from ‘ImagingResampleInner’ Pillow-12.1.0/src/libImaging/Resample.c:736:18: return_function: returning to ‘ImagingResampleInner’ from ‘precompute_coeffs’ Pillow-12.1.0/src/libImaging/Resample.c:739:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Resample.c:746:18: branch_false: ...to here Pillow-12.1.0/src/libImaging/Resample.c:751:8: branch_true: following ‘true’ branch... Pillow-12.1.0/src/libImaging/Resample.c:751:8: branch_true: ...to here Pillow-12.1.0/src/libImaging/Resample.c:757:18: throw: if ‘ImagingNewDirty’ throws an exception... Pillow-12.1.0/src/libImaging/Resample.c:757:18: danger: ‘bounds_horiz’ leaks here; was allocated at [(8)](sarif:/runs/0/results/13/codeFlows/0/threadFlows/0/locations/7) # 755| } # 756| # 757|-> imTemp = ImagingNewDirty(imIn->mode, xsize, ybox_last - ybox_first); # 758| if (imTemp) { # 759| ResampleHorizontal( Error: GCC_ANALYZER_WARNING (CWE-401): [#def127] Pillow-12.1.0/src/libImaging/Resample.c:757:18: warning[-Wanalyzer-malloc-leak]: leak of ‘bounds_vert’ Pillow-12.1.0/src/libImaging/Resample.c:708:1: enter_function: entry to ‘ImagingResampleInner’ Pillow-12.1.0/src/libImaging/Resample.c:729:19: call_function: calling ‘precompute_coeffs’ from ‘ImagingResampleInner’ Pillow-12.1.0/src/libImaging/Resample.c:729:19: return_function: returning to ‘ImagingResampleInner’ from ‘precompute_coeffs’ Pillow-12.1.0/src/libImaging/Resample.c:732:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Resample.c:736:18: branch_false: ...to here Pillow-12.1.0/src/libImaging/Resample.c:736:18: call_function: calling ‘precompute_coeffs’ from ‘ImagingResampleInner’ Pillow-12.1.0/src/libImaging/Resample.c:736:18: return_function: returning to ‘ImagingResampleInner’ from ‘precompute_coeffs’ Pillow-12.1.0/src/libImaging/Resample.c:739:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Resample.c:746:18: branch_false: ...to here Pillow-12.1.0/src/libImaging/Resample.c:751:8: branch_true: following ‘true’ branch... Pillow-12.1.0/src/libImaging/Resample.c:751:8: branch_true: ...to here Pillow-12.1.0/src/libImaging/Resample.c:757:18: throw: if ‘ImagingNewDirty’ throws an exception... Pillow-12.1.0/src/libImaging/Resample.c:757:18: danger: ‘bounds_vert’ leaks here; was allocated at [(19)](sarif:/runs/0/results/14/codeFlows/0/threadFlows/0/locations/18) # 755| } # 756| # 757|-> imTemp = ImagingNewDirty(imIn->mode, xsize, ybox_last - ybox_first); # 758| if (imTemp) { # 759| ResampleHorizontal( Error: GCC_ANALYZER_WARNING (CWE-401): [#def128] Pillow-12.1.0/src/libImaging/Resample.c:759:13: warning[-Wanalyzer-malloc-leak]: leak of ‘bounds_horiz’ Pillow-12.1.0/src/libImaging/Resample.c:708:1: enter_function: entry to ‘ImagingResampleInner’ Pillow-12.1.0/src/libImaging/Resample.c:729:19: call_function: calling ‘precompute_coeffs’ from ‘ImagingResampleInner’ Pillow-12.1.0/src/libImaging/Resample.c:729:19: return_function: returning to ‘ImagingResampleInner’ from ‘precompute_coeffs’ Pillow-12.1.0/src/libImaging/Resample.c:732:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Resample.c:736:18: branch_false: ...to here Pillow-12.1.0/src/libImaging/Resample.c:736:18: call_function: calling ‘precompute_coeffs’ from ‘ImagingResampleInner’ Pillow-12.1.0/src/libImaging/Resample.c:736:18: return_function: returning to ‘ImagingResampleInner’ from ‘precompute_coeffs’ Pillow-12.1.0/src/libImaging/Resample.c:739:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Resample.c:746:18: branch_false: ...to here Pillow-12.1.0/src/libImaging/Resample.c:751:8: branch_true: following ‘true’ branch... Pillow-12.1.0/src/libImaging/Resample.c:751:8: branch_true: ...to here Pillow-12.1.0/src/libImaging/Resample.c:758:12: branch_true: following ‘true’ branch... Pillow-12.1.0/src/libImaging/Resample.c:759:13: branch_true: ...to here Pillow-12.1.0/src/libImaging/Resample.c:759:13: throw: if the called function throws an exception... Pillow-12.1.0/src/libImaging/Resample.c:759:13: danger: ‘bounds_horiz’ leaks here; was allocated at [(8)](sarif:/runs/0/results/15/codeFlows/0/threadFlows/0/locations/7) # 757| imTemp = ImagingNewDirty(imIn->mode, xsize, ybox_last - ybox_first); # 758| if (imTemp) { # 759|-> ResampleHorizontal( # 760| imTemp, imIn, ybox_first, ksize_horiz, bounds_horiz, kk_horiz # 761| ); Error: GCC_ANALYZER_WARNING (CWE-401): [#def129] Pillow-12.1.0/src/libImaging/Resample.c:759:13: warning[-Wanalyzer-malloc-leak]: leak of ‘bounds_vert’ Pillow-12.1.0/src/libImaging/Resample.c:708:1: enter_function: entry to ‘ImagingResampleInner’ Pillow-12.1.0/src/libImaging/Resample.c:729:19: call_function: calling ‘precompute_coeffs’ from ‘ImagingResampleInner’ Pillow-12.1.0/src/libImaging/Resample.c:729:19: return_function: returning to ‘ImagingResampleInner’ from ‘precompute_coeffs’ Pillow-12.1.0/src/libImaging/Resample.c:732:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Resample.c:736:18: branch_false: ...to here Pillow-12.1.0/src/libImaging/Resample.c:736:18: call_function: calling ‘precompute_coeffs’ from ‘ImagingResampleInner’ Pillow-12.1.0/src/libImaging/Resample.c:736:18: return_function: returning to ‘ImagingResampleInner’ from ‘precompute_coeffs’ Pillow-12.1.0/src/libImaging/Resample.c:739:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Resample.c:746:18: branch_false: ...to here Pillow-12.1.0/src/libImaging/Resample.c:751:8: branch_true: following ‘true’ branch... Pillow-12.1.0/src/libImaging/Resample.c:751:8: branch_true: ...to here Pillow-12.1.0/src/libImaging/Resample.c:758:12: branch_true: following ‘true’ branch... Pillow-12.1.0/src/libImaging/Resample.c:759:13: branch_true: ...to here Pillow-12.1.0/src/libImaging/Resample.c:759:13: throw: if the called function throws an exception... Pillow-12.1.0/src/libImaging/Resample.c:759:13: danger: ‘bounds_vert’ leaks here; was allocated at [(19)](sarif:/runs/0/results/16/codeFlows/0/threadFlows/0/locations/18) # 757| imTemp = ImagingNewDirty(imIn->mode, xsize, ybox_last - ybox_first); # 758| if (imTemp) { # 759|-> ResampleHorizontal( # 760| imTemp, imIn, ybox_first, ksize_horiz, bounds_horiz, kk_horiz # 761| ); Error: GCC_ANALYZER_WARNING (CWE-401): [#def130] Pillow-12.1.0/src/libImaging/Resample.c:779:17: warning[-Wanalyzer-malloc-leak]: leak of ‘bounds_vert’ Pillow-12.1.0/src/libImaging/Resample.c:708:1: enter_function: entry to ‘ImagingResampleInner’ Pillow-12.1.0/src/libImaging/Resample.c:729:19: call_function: calling ‘precompute_coeffs’ from ‘ImagingResampleInner’ Pillow-12.1.0/src/libImaging/Resample.c:729:19: return_function: returning to ‘ImagingResampleInner’ from ‘precompute_coeffs’ Pillow-12.1.0/src/libImaging/Resample.c:732:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Resample.c:736:18: branch_false: ...to here Pillow-12.1.0/src/libImaging/Resample.c:736:18: call_function: calling ‘precompute_coeffs’ from ‘ImagingResampleInner’ Pillow-12.1.0/src/libImaging/Resample.c:736:18: return_function: returning to ‘ImagingResampleInner’ from ‘precompute_coeffs’ Pillow-12.1.0/src/libImaging/Resample.c:739:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Resample.c:746:18: branch_false: ...to here Pillow-12.1.0/src/libImaging/Resample.c:751:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Resample.c:773:9: branch_false: ...to here Pillow-12.1.0/src/libImaging/Resample.c:778:8: branch_true: following ‘true’ branch... Pillow-12.1.0/src/libImaging/Resample.c:779:17: branch_true: ...to here Pillow-12.1.0/src/libImaging/Resample.c:779:17: throw: if ‘ImagingNewDirty’ throws an exception... Pillow-12.1.0/src/libImaging/Resample.c:779:17: danger: ‘bounds_vert’ leaks here; was allocated at [(19)](sarif:/runs/0/results/17/codeFlows/0/threadFlows/0/locations/18) # 777| /* vertical pass */ # 778| if (need_vertical) { # 779|-> imOut = ImagingNewDirty(imIn->mode, imIn->xsize, ysize); # 780| if (imOut) { # 781| /* imIn can be the original image or horizontally resampled one */ Error: GCC_ANALYZER_WARNING (CWE-401): [#def131] Pillow-12.1.0/src/libImaging/Resample.c:782:13: warning[-Wanalyzer-malloc-leak]: leak of ‘bounds_vert’ Pillow-12.1.0/src/libImaging/Resample.c:708:1: enter_function: entry to ‘ImagingResampleInner’ Pillow-12.1.0/src/libImaging/Resample.c:729:19: call_function: calling ‘precompute_coeffs’ from ‘ImagingResampleInner’ Pillow-12.1.0/src/libImaging/Resample.c:729:19: return_function: returning to ‘ImagingResampleInner’ from ‘precompute_coeffs’ Pillow-12.1.0/src/libImaging/Resample.c:732:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Resample.c:736:18: branch_false: ...to here Pillow-12.1.0/src/libImaging/Resample.c:736:18: call_function: calling ‘precompute_coeffs’ from ‘ImagingResampleInner’ Pillow-12.1.0/src/libImaging/Resample.c:736:18: return_function: returning to ‘ImagingResampleInner’ from ‘precompute_coeffs’ Pillow-12.1.0/src/libImaging/Resample.c:739:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Resample.c:746:18: branch_false: ...to here Pillow-12.1.0/src/libImaging/Resample.c:751:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Resample.c:773:9: branch_false: ...to here Pillow-12.1.0/src/libImaging/Resample.c:778:8: branch_true: following ‘true’ branch... Pillow-12.1.0/src/libImaging/Resample.c:779:17: branch_true: ...to here Pillow-12.1.0/src/libImaging/Resample.c:780:12: branch_true: following ‘true’ branch... Pillow-12.1.0/src/libImaging/Resample.c:782:13: branch_true: ...to here Pillow-12.1.0/src/libImaging/Resample.c:782:13: throw: if the called function throws an exception... Pillow-12.1.0/src/libImaging/Resample.c:782:13: danger: ‘bounds_vert’ leaks here; was allocated at [(19)](sarif:/runs/0/results/18/codeFlows/0/threadFlows/0/locations/18) # 780| if (imOut) { # 781| /* imIn can be the original image or horizontally resampled one */ # 782|-> ResampleVertical(imOut, imIn, 0, ksize_vert, bounds_vert, kk_vert); # 783| } # 784| /* it's safe to call ImagingDelete with empty value Error: GCC_ANALYZER_WARNING (CWE-401): [#def132] Pillow-12.1.0/src/libImaging/Resample.c:786:9: warning[-Wanalyzer-malloc-leak]: leak of ‘bounds_vert’ Pillow-12.1.0/src/libImaging/Resample.c:708:1: enter_function: entry to ‘ImagingResampleInner’ Pillow-12.1.0/src/libImaging/Resample.c:729:19: call_function: calling ‘precompute_coeffs’ from ‘ImagingResampleInner’ Pillow-12.1.0/src/libImaging/Resample.c:729:19: return_function: returning to ‘ImagingResampleInner’ from ‘precompute_coeffs’ Pillow-12.1.0/src/libImaging/Resample.c:732:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Resample.c:736:18: branch_false: ...to here Pillow-12.1.0/src/libImaging/Resample.c:736:18: call_function: calling ‘precompute_coeffs’ from ‘ImagingResampleInner’ Pillow-12.1.0/src/libImaging/Resample.c:736:18: return_function: returning to ‘ImagingResampleInner’ from ‘precompute_coeffs’ Pillow-12.1.0/src/libImaging/Resample.c:739:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Resample.c:746:18: branch_false: ...to here Pillow-12.1.0/src/libImaging/Resample.c:751:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Resample.c:773:9: branch_false: ...to here Pillow-12.1.0/src/libImaging/Resample.c:778:8: branch_true: following ‘true’ branch... Pillow-12.1.0/src/libImaging/Resample.c:779:17: branch_true: ...to here Pillow-12.1.0/src/libImaging/Resample.c:780:12: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/Resample.c:786:9: branch_false: ...to here Pillow-12.1.0/src/libImaging/Resample.c:786:9: throw: if ‘ImagingDelete’ throws an exception... Pillow-12.1.0/src/libImaging/Resample.c:786:9: danger: ‘bounds_vert’ leaks here; was allocated at [(19)](sarif:/runs/0/results/19/codeFlows/0/threadFlows/0/locations/18) # 784| /* it's safe to call ImagingDelete with empty value # 785| if previous step was not performed. */ # 786|-> ImagingDelete(imTemp); # 787| free(bounds_vert); # 788| free(kk_vert); Error: GCC_ANALYZER_WARNING (CWE-401): [#def133] Pillow-12.1.0/src/libImaging/SgiRleDecode.c:197:5: warning[-Wanalyzer-malloc-leak]: leak of ‘ptr’ Pillow-12.1.0/src/libImaging/SgiRleDecode.c:171:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/SgiRleDecode.c:187:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/SgiRleDecode.c:192:11: branch_false: ...to here Pillow-12.1.0/src/libImaging/SgiRleDecode.c:192:11: acquire_memory: allocated here Pillow-12.1.0/src/libImaging/SgiRleDecode.c:193:8: branch_false: following ‘false’ branch (when ‘ptr’ is non-NULL)... Pillow-12.1.0/src/libImaging/SgiRleDecode.c:197:5: branch_false: ...to here Pillow-12.1.0/src/libImaging/SgiRleDecode.c:197:5: throw: if ‘_imaging_seek_pyFd’ throws an exception... Pillow-12.1.0/src/libImaging/SgiRleDecode.c:197:5: danger: ‘ptr’ leaks here; was allocated at [(5)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/4) # 195| return -1; # 196| } # 197|-> _imaging_seek_pyFd(state->fd, SGI_HEADER_SIZE, SEEK_SET); # 198| if (_imaging_read_pyFd(state->fd, (char *)ptr, c->bufsize) != c->bufsize) { # 199| free(ptr); Error: GCC_ANALYZER_WARNING (CWE-401): [#def134] Pillow-12.1.0/src/libImaging/SgiRleDecode.c:198:9: warning[-Wanalyzer-malloc-leak]: leak of ‘ptr’ Pillow-12.1.0/src/libImaging/SgiRleDecode.c:171:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/SgiRleDecode.c:187:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/SgiRleDecode.c:192:11: branch_false: ...to here Pillow-12.1.0/src/libImaging/SgiRleDecode.c:192:11: acquire_memory: allocated here Pillow-12.1.0/src/libImaging/SgiRleDecode.c:193:8: branch_false: following ‘false’ branch (when ‘ptr’ is non-NULL)... Pillow-12.1.0/src/libImaging/SgiRleDecode.c:197:5: branch_false: ...to here Pillow-12.1.0/src/libImaging/SgiRleDecode.c:198:9: throw: if ‘_imaging_read_pyFd’ throws an exception... Pillow-12.1.0/src/libImaging/SgiRleDecode.c:198:9: danger: ‘ptr’ leaks here; was allocated at [(5)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/4) # 196| } # 197| _imaging_seek_pyFd(state->fd, SGI_HEADER_SIZE, SEEK_SET); # 198|-> if (_imaging_read_pyFd(state->fd, (char *)ptr, c->bufsize) != c->bufsize) { # 199| free(ptr); # 200| state->errcode = IMAGING_CODEC_UNKNOWN; Error: GCC_ANALYZER_WARNING (CWE-401): [#def135] Pillow-12.1.0/src/libImaging/SgiRleDecode.c:220:8: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc((long unsigned int)*c.tablen, 4)’ Pillow-12.1.0/src/libImaging/SgiRleDecode.c:171:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/SgiRleDecode.c:187:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/SgiRleDecode.c:192:11: branch_false: ...to here Pillow-12.1.0/src/libImaging/SgiRleDecode.c:193:8: branch_false: following ‘false’ branch (when ‘ptr’ is non-NULL)... Pillow-12.1.0/src/libImaging/SgiRleDecode.c:197:5: branch_false: ...to here Pillow-12.1.0/src/libImaging/SgiRleDecode.c:198:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/SgiRleDecode.c:205:5: branch_false: ...to here Pillow-12.1.0/src/libImaging/SgiRleDecode.c:218:19: acquire_memory: allocated here Pillow-12.1.0/src/libImaging/SgiRleDecode.c:220:8: danger: ‘calloc((long unsigned int)*c.tablen, 4)’ leaks here; was allocated at [(9)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/8) # 218| c->starttab = calloc(c->tablen, sizeof(UINT32)); # 219| c->lengthtab = calloc(c->tablen, sizeof(UINT32)); # 220|-> if (!state->buffer || !c->starttab || !c->lengthtab) { # 221| err = IMAGING_CODEC_MEMORY; # 222| goto sgi_finish_decode; Error: GCC_ANALYZER_WARNING (CWE-401): [#def136] Pillow-12.1.0/src/libImaging/SgiRleDecode.c:220:9: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc((long unsigned int)*c.tablen, 4)’ Pillow-12.1.0/src/libImaging/SgiRleDecode.c:171:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/SgiRleDecode.c:187:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/SgiRleDecode.c:192:11: branch_false: ...to here Pillow-12.1.0/src/libImaging/SgiRleDecode.c:193:8: branch_false: following ‘false’ branch (when ‘ptr’ is non-NULL)... Pillow-12.1.0/src/libImaging/SgiRleDecode.c:197:5: branch_false: ...to here Pillow-12.1.0/src/libImaging/SgiRleDecode.c:198:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/SgiRleDecode.c:205:5: branch_false: ...to here Pillow-12.1.0/src/libImaging/SgiRleDecode.c:219:20: acquire_memory: allocated here Pillow-12.1.0/src/libImaging/SgiRleDecode.c:220:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/SgiRleDecode.c:220:9: branch_false: ...to here Pillow-12.1.0/src/libImaging/SgiRleDecode.c:220:9: danger: ‘calloc((long unsigned int)*c.tablen, 4)’ leaks here; was allocated at [(9)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/8) # 218| c->starttab = calloc(c->tablen, sizeof(UINT32)); # 219| c->lengthtab = calloc(c->tablen, sizeof(UINT32)); # 220|-> if (!state->buffer || !c->starttab || !c->lengthtab) { # 221| err = IMAGING_CODEC_MEMORY; # 222| goto sgi_finish_decode; Error: GCC_ANALYZER_WARNING (CWE-401): [#def137] Pillow-12.1.0/src/libImaging/SgiRleDecode.c:220:9: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc((long unsigned int)*c.tablen, 4)’ Pillow-12.1.0/src/libImaging/SgiRleDecode.c:171:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/SgiRleDecode.c:187:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/SgiRleDecode.c:192:11: branch_false: ...to here Pillow-12.1.0/src/libImaging/SgiRleDecode.c:193:8: branch_false: following ‘false’ branch (when ‘ptr’ is non-NULL)... Pillow-12.1.0/src/libImaging/SgiRleDecode.c:197:5: branch_false: ...to here Pillow-12.1.0/src/libImaging/SgiRleDecode.c:198:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/SgiRleDecode.c:205:5: branch_false: ...to here Pillow-12.1.0/src/libImaging/SgiRleDecode.c:218:19: acquire_memory: allocated here Pillow-12.1.0/src/libImaging/SgiRleDecode.c:220:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/SgiRleDecode.c:220:9: branch_false: ...to here Pillow-12.1.0/src/libImaging/SgiRleDecode.c:220:9: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/SgiRleDecode.c:220:9: branch_false: ...to here Pillow-12.1.0/src/libImaging/SgiRleDecode.c:220:9: danger: ‘calloc((long unsigned int)*c.tablen, 4)’ leaks here; was allocated at [(9)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/8) # 218| c->starttab = calloc(c->tablen, sizeof(UINT32)); # 219| c->lengthtab = calloc(c->tablen, sizeof(UINT32)); # 220|-> if (!state->buffer || !c->starttab || !c->lengthtab) { # 221| err = IMAGING_CODEC_MEMORY; # 222| goto sgi_finish_decode; Error: GCC_ANALYZER_WARNING (CWE-401): [#def138] Pillow-12.1.0/src/libImaging/SgiRleDecode.c:225:44: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc((long unsigned int)*c.tablen, 4)’ Pillow-12.1.0/src/libImaging/SgiRleDecode.c:171:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/SgiRleDecode.c:187:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/SgiRleDecode.c:192:11: branch_false: ...to here Pillow-12.1.0/src/libImaging/SgiRleDecode.c:193:8: branch_false: following ‘false’ branch (when ‘ptr’ is non-NULL)... Pillow-12.1.0/src/libImaging/SgiRleDecode.c:197:5: branch_false: ...to here Pillow-12.1.0/src/libImaging/SgiRleDecode.c:198:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/SgiRleDecode.c:205:5: branch_false: ...to here Pillow-12.1.0/src/libImaging/SgiRleDecode.c:218:19: acquire_memory: allocated here Pillow-12.1.0/src/libImaging/SgiRleDecode.c:220:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/SgiRleDecode.c:220:9: branch_false: ...to here Pillow-12.1.0/src/libImaging/SgiRleDecode.c:220:9: branch_false: following ‘false’ branch... Pillow-12.1.0/src/libImaging/SgiRleDecode.c:225:44: danger: ‘calloc((long unsigned int)*c.tablen, 4)’ leaks here; was allocated at [(9)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/8) # 223| } # 224| /* populate offsets table */ # 225|-> for (c->tabindex = 0, c->bufindex = 0; c->tabindex < c->tablen; # 226| c->tabindex++, c->bufindex += 4) { # 227| read4B(&c->starttab[c->tabindex], &ptr[c->bufindex]); Error: GCC_ANALYZER_WARNING (CWE-401): [#def139] Pillow-12.1.0/src/libImaging/Storage.c:75:23: warning[-Wanalyzer-malloc-leak]: leak of ‘im’ Pillow-12.1.0/src/libImaging/Storage.c:53:19: acquire_memory: allocated here Pillow-12.1.0/src/libImaging/Storage.c:54:8: branch_false: following ‘false’ branch (when ‘im’ is non-NULL)... Pillow-12.1.0/src/libImaging/Storage.c:59:5: branch_false: ...to here Pillow-12.1.0/src/libImaging/Storage.c:75:23: throw: if ‘ImagingPaletteNew’ throws an exception... Pillow-12.1.0/src/libImaging/Storage.c:75:23: danger: ‘im’ leaks here; was allocated at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0) # 73| im->bands = im->pixelsize = 1; # 74| im->linesize = xsize; # 75|-> im->palette = ImagingPaletteNew(IMAGING_MODE_RGB); # 76| strcpy(im->band_names[0], "P"); # 77| Error: GCC_ANALYZER_WARNING (CWE-401): [#def140] Pillow-12.1.0/src/libImaging/Storage.c:83:23: warning[-Wanalyzer-malloc-leak]: leak of ‘im’ Pillow-12.1.0/src/libImaging/Storage.c:53:19: acquire_memory: allocated here Pillow-12.1.0/src/libImaging/Storage.c:54:8: branch_false: following ‘false’ branch (when ‘im’ is non-NULL)... Pillow-12.1.0/src/libImaging/Storage.c:59:5: branch_false: ...to here Pillow-12.1.0/src/libImaging/Storage.c:83:23: throw: if ‘ImagingPaletteNew’ throws an exception... Pillow-12.1.0/src/libImaging/Storage.c:83:23: danger: ‘im’ leaks here; was allocated at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0) # 81| im->pixelsize = 4; /* store in image32 memory */ # 82| im->linesize = xsize * 4; # 83|-> im->palette = ImagingPaletteNew(IMAGING_MODE_RGB); # 84| strcpy(im->band_names[0], "P"); # 85| strcpy(im->band_names[1], "X"); Error: GCC_ANALYZER_WARNING (CWE-401): [#def141] Pillow-12.1.0/src/libImaging/Storage.c:133:16: warning[-Wanalyzer-malloc-leak]: leak of ‘im’ Pillow-12.1.0/src/libImaging/Storage.c:53:19: acquire_memory: allocated here Pillow-12.1.0/src/libImaging/Storage.c:54:8: branch_false: following ‘false’ branch (when ‘im’ is non-NULL)... Pillow-12.1.0/src/libImaging/Storage.c:59:5: branch_false: ...to here Pillow-12.1.0/src/libImaging/Storage.c:133:16: throw: if ‘isModeI16’ throws an exception... Pillow-12.1.0/src/libImaging/Storage.c:133:16: danger: ‘im’ leaks here; was allocated at [(1)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/0) # 131| strcpy(im->band_names[0], "I"); # 132| # 133|-> } else if (isModeI16(mode)) { # 134| /* EXPERIMENTAL */ # 135| /* 16-bit raw integer images */ Error: GCC_ANALYZER_WARNING (CWE-401): [#def142] Pillow-12.1.0/src/libImaging/Storage.c:411:1: warning[-Wanalyzer-malloc-leak]: leak of ‘block.ptr’ Pillow-12.1.0/src/libImaging/Storage.c:414:1: enter_function: entry to ‘ImagingDestroyArray’ Pillow-12.1.0/src/libImaging/Storage.c:419:16: branch_true: following ‘true’ branch... Pillow-12.1.0/src/libImaging/Storage.c:420:13: branch_true: ...to here Pillow-12.1.0/src/libImaging/Storage.c:420:13: call_function: calling ‘memory_return_block’ from ‘ImagingDestroyArray’ # 409| arena->stats_freed_blocks += 1; # 410| } # 411|-> } # 412| # 413| static void Error: GCC_ANALYZER_WARNING (CWE-404): [#def143] Pillow-12.1.0/src/libImaging/TiffDecode.c:934:14: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’ Pillow-12.1.0/src/libImaging/TiffDecode.c:933:5: acquire_resource: ‘va_start’ called here Pillow-12.1.0/src/libImaging/TiffDecode.c:934:14: throw: if ‘TIFFVSetField’ throws an exception... Pillow-12.1.0/src/libImaging/TiffDecode.c:934:14: danger: missing call to ‘va_end’ to match ‘va_start’ at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0) # 932| # 933| va_start(ap, tag); # 934|-> status = TIFFVSetField(clientstate->tiff, tag, ap); # 935| va_end(ap); # 936| return status; Error: GCC_ANALYZER_WARNING (CWE-401): [#def144] Pillow-12.1.0/src/path.c:58:9: warning[-Wanalyzer-malloc-leak]: leak of ‘alloc_array(PyObject_Size(data))’ Pillow-12.1.0/src/path.c:261:1: enter_function: entry to ‘PyPath_Create’ Pillow-12.1.0/src/path.c:266:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/path.c:275:9: branch_false: ...to here Pillow-12.1.0/src/path.c:276:12: branch_false: following ‘false’ branch... Pillow-12.1.0/src/path.c:280:17: branch_false: ...to here Pillow-12.1.0/src/path.c:280:17: call_function: calling ‘PyPath_Flatten’ from ‘PyPath_Create’ # 56| return ImagingError_MemoryError(); # 57| } # 58|-> if ((unsigned long long)count > (SIZE_MAX / (2 * sizeof(double))) - 1) { # 59| return ImagingError_MemoryError(); # 60| } Error: GCC_ANALYZER_WARNING (CWE-401): [#def145] Pillow-12.1.0/src/path.c:61:17: warning[-Wanalyzer-malloc-leak]: leak of ‘alloc_array(0)’ Pillow-12.1.0/src/path.c:572:1: enter_function: entry to ‘path_subscript’ Pillow-12.1.0/src/path.c:573:8: branch_false: following ‘false’ branch... Pillow-12.1.0/src/path.c:581:9: call_function: inlined call to ‘Py_IS_TYPE’ from ‘path_subscript’ Pillow-12.1.0/src/path.c:581:8: branch_true: following ‘true’ branch... Pillow-12.1.0/src/path.c:585:13: branch_true: ...to here Pillow-12.1.0/src/path.c:585:13: branch_false: following ‘false’ branch... Pillow-12.1.0/src/path.c:585:13: branch_false: ...to here Pillow-12.1.0/src/path.c:589:12: branch_true: following ‘true’ branch... Pillow-12.1.0/src/path.c:590:26: call_function: inlined call to ‘alloc_array’ from ‘path_subscript’ Pillow-12.1.0/src/path.c:590:26: call_function: inlined call to ‘alloc_array’ from ‘path_subscript’ Pillow-12.1.0/src/path.c:591:32: call_function: calling ‘path_new’ from ‘path_subscript’ # 59| return ImagingError_MemoryError(); # 60| } # 61|-> xy = calloc(2 * count + 1, sizeof(double)); # 62| if (!xy) { # 63| ImagingError_MemoryError(); Error: GCC_ANALYZER_WARNING (CWE-401): [#def146] Pillow-12.1.0/src/path.c:82:9: warning[-Wanalyzer-malloc-leak]: leak of ‘xy’ Pillow-12.1.0/src/path.c:261:1: enter_function: entry to ‘PyPath_Create’ Pillow-12.1.0/src/path.c:266:8: branch_true: following ‘true’ branch... Pillow-12.1.0/src/path.c:268:14: branch_true: ...to here Pillow-12.1.0/src/path.c:268:14: call_function: calling ‘alloc_array’ from ‘PyPath_Create’ Pillow-12.1.0/src/path.c:268:14: return_function: returning to ‘PyPath_Create’ from ‘alloc_array’ Pillow-12.1.0/src/path.c:269:12: branch_false: following ‘false’ branch... Pillow-12.1.0/src/path.c:286:24: branch_false: ...to here Pillow-12.1.0/src/path.c:286:24: call_function: calling ‘path_new’ from ‘PyPath_Create’ # 80| } # 81| # 82|-> if (PyType_Ready(&PyPathType) < 0) { # 83| free(xy); # 84| return NULL; Error: GCC_ANALYZER_WARNING (CWE-401): [#def147] Pillow-12.1.0/src/path.c:87:12: warning[-Wanalyzer-malloc-leak]: leak of ‘xy’ Pillow-12.1.0/src/path.c:261:1: enter_function: entry to ‘PyPath_Create’ Pillow-12.1.0/src/path.c:266:8: branch_true: following ‘true’ branch... Pillow-12.1.0/src/path.c:268:14: branch_true: ...to here Pillow-12.1.0/src/path.c:268:14: call_function: calling ‘alloc_array’ from ‘PyPath_Create’ Pillow-12.1.0/src/path.c:268:14: return_function: returning to ‘PyPath_Create’ from ‘alloc_array’ Pillow-12.1.0/src/path.c:269:12: branch_false: following ‘false’ branch... Pillow-12.1.0/src/path.c:286:24: branch_false: ...to here Pillow-12.1.0/src/path.c:286:24: call_function: calling ‘path_new’ from ‘PyPath_Create’ # 85| } # 86| # 87|-> path = PyObject_New(PyPathObject, &PyPathType); # 88| if (path == NULL) { # 89| free(xy);
| analyzer-version-clippy | 1.92.0 |
| analyzer-version-cppcheck | 2.19.1 |
| analyzer-version-gcc | 16.0.0 |
| analyzer-version-gcc-analyzer | 16.0.0 |
| analyzer-version-shellcheck | 0.11.0 |
| analyzer-version-unicontrol | 0.0.2 |
| enabled-plugins | clippy, cppcheck, gcc, shellcheck, unicontrol |
| exit-code | 0 |
| host | ip-172-16-1-38.us-west-2.compute.internal |
| known-false-positives | /usr/share/csmock/known-false-positives.js |
| known-false-positives-rpm | known-false-positives-0.0.0.20250521.132812.g8eff701.main-1.el9.noarch |
| mock-config | fedora-rawhide-x86_64 |
| project-name | python-pillow-12.1.0-1.fc44 |
| store-results-to | /tmp/tmpl6ekvhco/python-pillow-12.1.0-1.fc44.tar.xz |
| time-created | 2026-01-08 20:55:17 |
| time-finished | 2026-01-08 20:58:58 |
| tool | csmock |
| tool-args | '/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'gcc,cppcheck,clippy,shellcheck,unicontrol' '-o' '/tmp/tmpl6ekvhco/python-pillow-12.1.0-1.fc44.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '--gcc-analyzer-bin=/usr/bin/gcc' '/tmp/tmpl6ekvhco/python-pillow-12.1.0-1.fc44.src.rpm' |
| tool-version | csmock-3.8.3.20251215.161544.g62de9a5-1.el9 |