Task #91889 - added.err
back to task #91889download
Error: GCC_ANALYZER_WARNING (CWE-401):
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):
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: GCC_ANALYZER_WARNING (CWE-401):
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):
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):
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):
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 */