libpng-1.6.53-1.fc44

List of Findings

Error: SHELLCHECK_WARNING (CWE-563): [#def1]
/usr/bin/libpng16-config:16:1: warning[SC2034]: exec_prefix appears unused. Verify use (or export if used externally).
#   14|   version=`pkg-config --modversion libpng`
#   15|   prefix=`pkg-config --variable prefix libpng`
#   16|-> exec_prefix=`pkg-config --variable exec_prefix libpng`
#   17|   libdir=`pkg-config --variable libdir libpng`
#   18|   includedir=`pkg-config --variable includedir libpng`

Error: CPPCHECK_WARNING (CWE-476): [#def2]
libpng-1.6.53/contrib/libtests/pngimage.c:808: warning[nullPointerOutOfResources]: If resource allocation fails, then there is a possible null pointer dereference: fp
#  806|      ret = buffer_from_file(&dp->original_file, fp);
#  807|   
#  808|->    fclose(fp);
#  809|   
#  810|      if (ret != 0)

Error: GCC_ANALYZER_WARNING (CWE-457): [#def3]
libpng-1.6.53/contrib/libtests/pngstest.c:3011:35: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘*background.blue’
libpng-1.6.53/contrib/libtests/pngstest.c:3311:1: enter_function: entry to ‘testimage’
libpng-1.6.53/contrib/libtests/pngstest.c:3342:23: branch_true: following ‘true’ branch (when ‘counter != 128’)...
libpng-1.6.53/contrib/libtests/pngstest.c:3343:14: branch_true: ...to here
libpng-1.6.53/contrib/libtests/pngstest.c:3343:14: call_function: inlined call to ‘format_isset’ from ‘testimage’
libpng-1.6.53/contrib/libtests/pngstest.c:3356:14: branch_true: ...to here
libpng-1.6.53/contrib/libtests/pngstest.c:3356:13: branch_true: following ‘true’ branch...
libpng-1.6.53/contrib/libtests/pngstest.c:3358:17: branch_true: ...to here
libpng-1.6.53/contrib/libtests/pngstest.c:3358:16: branch_true: following ‘true’ branch...
libpng-1.6.53/contrib/libtests/pngstest.c:3359:17: branch_true: ...to here
libpng-1.6.53/contrib/libtests/pngstest.c:3358:17: branch_true: following ‘true’ branch...
libpng-1.6.53/contrib/libtests/pngstest.c:3364:16: call_function: inlined call to ‘random_color’ from ‘testimage’
libpng-1.6.53/contrib/libtests/pngstest.c:3364:16: call_function: inlined call to ‘random_color’ from ‘testimage’
libpng-1.6.53/contrib/libtests/pngstest.c:3371:19: branch_false: following ‘false’ branch...
libpng-1.6.53/contrib/libtests/pngstest.c:3384:10: call_function: inlined call to ‘resetimage’ from ‘testimage’
libpng-1.6.53/contrib/libtests/pngstest.c:3387:19: call_function: calling ‘read_file’ from ‘testimage’
# 3009|            if (background != NULL)
# 3010|               printf(" background(%d,%d,%d)\n", background->red,
# 3011|->                background->green, background->blue);
# 3012|            else
# 3013|               printf("\n");

Error: GCC_ANALYZER_WARNING (CWE-775): [#def4]
libpng-1.6.53/contrib/libtests/pngstest.c:3064:14: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(*image.file_name, "rb")’
libpng-1.6.53/contrib/libtests/pngstest.c:3060:17: acquire_resource: opened here
libpng-1.6.53/contrib/libtests/pngstest.c:3062:10: branch_true: following ‘true’ branch...
libpng-1.6.53/contrib/libtests/pngstest.c:3064:14: branch_true: ...to here
libpng-1.6.53/contrib/libtests/pngstest.c:3064:13: branch_false: following ‘false’ branch...
libpng-1.6.53/contrib/libtests/pngstest.c:3069:17: branch_false: ...to here
libpng-1.6.53/contrib/libtests/pngstest.c:3069:17: throw: if ‘fseek’ throws an exception...
libpng-1.6.53/contrib/libtests/pngstest.c:3064:14: danger: ‘fopen(*image.file_name, "rb")’ leaks here; was opened at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
# 3062|         if (f != NULL)
# 3063|         {
# 3064|->          if (image->opts & USE_FILE)
# 3065|               image->input_file = f;
# 3066|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def5]
libpng-1.6.53/contrib/libtests/pngstest.c:3064:14: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(*image.file_name, "rb")’
libpng-1.6.53/contrib/libtests/pngstest.c:3060:17: acquire_memory: allocated here
libpng-1.6.53/contrib/libtests/pngstest.c:3062:10: branch_true: following ‘true’ branch...
libpng-1.6.53/contrib/libtests/pngstest.c:3064:14: branch_true: ...to here
libpng-1.6.53/contrib/libtests/pngstest.c:3064:13: branch_false: following ‘false’ branch...
libpng-1.6.53/contrib/libtests/pngstest.c:3069:17: branch_false: ...to here
libpng-1.6.53/contrib/libtests/pngstest.c:3069:17: throw: if ‘fseek’ throws an exception...
libpng-1.6.53/contrib/libtests/pngstest.c:3064:14: danger: ‘fopen(*image.file_name, "rb")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/0)
# 3062|         if (f != NULL)
# 3063|         {
# 3064|->          if (image->opts & USE_FILE)
# 3065|               image->input_file = f;
# 3066|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def6]
libpng-1.6.53/contrib/libtests/pngstest.c:3083:25: warning[-Wanalyzer-malloc-leak]: leak of ‘b’
libpng-1.6.53/contrib/libtests/pngstest.c:3062:10: branch_true: following ‘true’ branch...
libpng-1.6.53/contrib/libtests/pngstest.c:3064:14: branch_true: ...to here
libpng-1.6.53/contrib/libtests/pngstest.c:3064:13: branch_false: following ‘false’ branch...
libpng-1.6.53/contrib/libtests/pngstest.c:3069:17: branch_false: ...to here
libpng-1.6.53/contrib/libtests/pngstest.c:3069:16: branch_true: following ‘true’ branch...
libpng-1.6.53/contrib/libtests/pngstest.c:3071:30: branch_true: ...to here
libpng-1.6.53/contrib/libtests/pngstest.c:3073:19: branch_true: following ‘true’ branch...
libpng-1.6.53/contrib/libtests/pngstest.c:3079:36: branch_true: ...to here
libpng-1.6.53/contrib/libtests/pngstest.c:3079:36: acquire_memory: allocated here
libpng-1.6.53/contrib/libtests/pngstest.c:3081:25: branch_true: following ‘true’ branch (when ‘b’ is non-NULL)...
libpng-1.6.53/contrib/libtests/pngstest.c:3083:25: branch_true: ...to here
libpng-1.6.53/contrib/libtests/pngstest.c:3083:25: throw: if ‘rewind’ throws an exception...
libpng-1.6.53/contrib/libtests/pngstest.c:3083:25: danger: ‘b’ leaks here; was allocated at [(9)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/8)
# 3081|                        if (b != NULL)
# 3082|                        {
# 3083|->                         rewind(f);
# 3084|   
# 3085|                           if (fread(b, (size_t)cb, 1, f) == 1)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def7]
libpng-1.6.53/contrib/libtests/pngstest.c:3184:58: warning[-Wanalyzer-malloc-leak]: leak of ‘tmpfile()’
libpng-1.6.53/contrib/libtests/pngstest.c:3143:7: branch_true: following ‘true’ branch...
libpng-1.6.53/contrib/libtests/pngstest.c:3147:17: branch_true: ...to here
libpng-1.6.53/contrib/libtests/pngstest.c:3147:17: acquire_memory: allocated here
libpng-1.6.53/contrib/libtests/pngstest.c:3181:10: branch_true: following ‘true’ branch...
libpng-1.6.53/contrib/libtests/pngstest.c:3184:58: branch_true: ...to here
libpng-1.6.53/contrib/libtests/pngstest.c:3183:14: throw: if ‘png_image_write_to_stdio’ throws an exception...
libpng-1.6.53/contrib/libtests/pngstest.c:3184:58: danger: ‘tmpfile()’ leaks here; was allocated at [(3)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/2)
# 3182|         {
# 3183|            if (png_image_write_to_stdio(&image->image, f, convert_to_8bit,
# 3184|->             image->buffer+16, (png_int_32)image->stride, image->colormap))
# 3185|            {
# 3186|               if (fflush(f) == 0)

Error: GCC_ANALYZER_WARNING (CWE-775): [#def8]
libpng-1.6.53/contrib/libtests/pngunknown.c:660:17: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(*<unknown>, "rb")’
libpng-1.6.53/contrib/libtests/pngunknown.c:1103:1: enter_function: entry to ‘main’
libpng-1.6.53/contrib/libtests/pngunknown.c:1122:15: branch_false: following ‘false’ branch (when the strings are non-equal)...
libpng-1.6.53/contrib/libtests/pngunknown.c:1138:7: branch_false: ...to here
libpng-1.6.53/contrib/libtests/pngunknown.c:1138:7: branch_false: following ‘false’ branch (when ‘argc > 0’)...
libpng-1.6.53/contrib/libtests/pngunknown.c:1144:12: branch_false: ...to here
libpng-1.6.53/contrib/libtests/pngunknown.c:1151:9: acquire_resource: opened here
libpng-1.6.53/contrib/libtests/pngunknown.c:1152:7: branch_false: following ‘false’ branch...
libpng-1.6.53/contrib/libtests/pngunknown.c:1167:8: branch_false: ...to here
libpng-1.6.53/contrib/libtests/pngunknown.c:1167:8: call_function: calling ‘check’ from ‘main’
#  658|       * are per-test and cause an error return.
#  659|       */
#  660|->    d->png_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING, d, error,
#  661|         warning);
#  662|      if (d->png_ptr == NULL)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def9]
libpng-1.6.53/contrib/libtests/pngunknown.c:660:17: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(*<unknown>, "rb")’
libpng-1.6.53/contrib/libtests/pngunknown.c:1103:1: enter_function: entry to ‘main’
libpng-1.6.53/contrib/libtests/pngunknown.c:1122:15: branch_false: following ‘false’ branch (when the strings are non-equal)...
libpng-1.6.53/contrib/libtests/pngunknown.c:1138:7: branch_false: ...to here
libpng-1.6.53/contrib/libtests/pngunknown.c:1138:7: branch_false: following ‘false’ branch (when ‘argc > 0’)...
libpng-1.6.53/contrib/libtests/pngunknown.c:1144:12: branch_false: ...to here
libpng-1.6.53/contrib/libtests/pngunknown.c:1151:9: acquire_memory: allocated here
libpng-1.6.53/contrib/libtests/pngunknown.c:1152:7: branch_false: following ‘false’ branch...
libpng-1.6.53/contrib/libtests/pngunknown.c:1167:8: branch_false: ...to here
libpng-1.6.53/contrib/libtests/pngunknown.c:1167:8: call_function: calling ‘check’ from ‘main’
#  658|       * are per-test and cause an error return.
#  659|       */
#  660|->    d->png_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING, d, error,
#  661|         warning);
#  662|      if (d->png_ptr == NULL)

Error: GCC_ANALYZER_WARNING (CWE-775): [#def10]
libpng-1.6.53/contrib/libtests/pngunknown.c:670:18: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(*<unknown>, "rb")’
libpng-1.6.53/contrib/libtests/pngunknown.c:1103:1: enter_function: entry to ‘main’
libpng-1.6.53/contrib/libtests/pngunknown.c:1122:15: branch_false: following ‘false’ branch (when the strings are non-equal)...
libpng-1.6.53/contrib/libtests/pngunknown.c:1138:7: branch_false: ...to here
libpng-1.6.53/contrib/libtests/pngunknown.c:1138:7: branch_false: following ‘false’ branch (when ‘argc > 0’)...
libpng-1.6.53/contrib/libtests/pngunknown.c:1144:12: branch_false: ...to here
libpng-1.6.53/contrib/libtests/pngunknown.c:1151:9: acquire_resource: opened here
libpng-1.6.53/contrib/libtests/pngunknown.c:1152:7: branch_false: following ‘false’ branch...
libpng-1.6.53/contrib/libtests/pngunknown.c:1167:8: branch_false: ...to here
libpng-1.6.53/contrib/libtests/pngunknown.c:1167:8: call_function: calling ‘check’ from ‘main’
#  668|      }
#  669|   
#  670|->    d->info_ptr = png_create_info_struct(d->png_ptr);
#  671|      d->end_ptr = png_create_info_struct(d->png_ptr);
#  672|      if (d->info_ptr == NULL || d->end_ptr == NULL)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def11]
libpng-1.6.53/contrib/libtests/pngunknown.c:670:18: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(*<unknown>, "rb")’
libpng-1.6.53/contrib/libtests/pngunknown.c:1103:1: enter_function: entry to ‘main’
libpng-1.6.53/contrib/libtests/pngunknown.c:1122:15: branch_false: following ‘false’ branch (when the strings are non-equal)...
libpng-1.6.53/contrib/libtests/pngunknown.c:1138:7: branch_false: ...to here
libpng-1.6.53/contrib/libtests/pngunknown.c:1138:7: branch_false: following ‘false’ branch (when ‘argc > 0’)...
libpng-1.6.53/contrib/libtests/pngunknown.c:1144:12: branch_false: ...to here
libpng-1.6.53/contrib/libtests/pngunknown.c:1151:9: acquire_memory: allocated here
libpng-1.6.53/contrib/libtests/pngunknown.c:1152:7: branch_false: following ‘false’ branch...
libpng-1.6.53/contrib/libtests/pngunknown.c:1167:8: branch_false: ...to here
libpng-1.6.53/contrib/libtests/pngunknown.c:1167:8: call_function: calling ‘check’ from ‘main’
#  668|      }
#  669|   
#  670|->    d->info_ptr = png_create_info_struct(d->png_ptr);
#  671|      d->end_ptr = png_create_info_struct(d->png_ptr);
#  672|      if (d->info_ptr == NULL || d->end_ptr == NULL)

Error: GCC_ANALYZER_WARNING (CWE-775): [#def12]
libpng-1.6.53/contrib/libtests/pngunknown.c:671:40: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(*<unknown>, "rb")’
libpng-1.6.53/contrib/libtests/pngunknown.c:1103:1: enter_function: entry to ‘main’
libpng-1.6.53/contrib/libtests/pngunknown.c:1122:15: branch_false: following ‘false’ branch (when the strings are non-equal)...
libpng-1.6.53/contrib/libtests/pngunknown.c:1138:7: branch_false: ...to here
libpng-1.6.53/contrib/libtests/pngunknown.c:1138:7: branch_false: following ‘false’ branch (when ‘argc > 0’)...
libpng-1.6.53/contrib/libtests/pngunknown.c:1144:12: branch_false: ...to here
libpng-1.6.53/contrib/libtests/pngunknown.c:1151:9: acquire_resource: opened here
libpng-1.6.53/contrib/libtests/pngunknown.c:1152:7: branch_false: following ‘false’ branch...
libpng-1.6.53/contrib/libtests/pngunknown.c:1167:8: branch_false: ...to here
libpng-1.6.53/contrib/libtests/pngunknown.c:1167:8: call_function: calling ‘check’ from ‘main’
#  669|   
#  670|      d->info_ptr = png_create_info_struct(d->png_ptr);
#  671|->    d->end_ptr = png_create_info_struct(d->png_ptr);
#  672|      if (d->info_ptr == NULL || d->end_ptr == NULL)
#  673|      {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def13]
libpng-1.6.53/contrib/libtests/pngunknown.c:671:40: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(*<unknown>, "rb")’
libpng-1.6.53/contrib/libtests/pngunknown.c:1103:1: enter_function: entry to ‘main’
libpng-1.6.53/contrib/libtests/pngunknown.c:1122:15: branch_false: following ‘false’ branch (when the strings are non-equal)...
libpng-1.6.53/contrib/libtests/pngunknown.c:1138:7: branch_false: ...to here
libpng-1.6.53/contrib/libtests/pngunknown.c:1138:7: branch_false: following ‘false’ branch (when ‘argc > 0’)...
libpng-1.6.53/contrib/libtests/pngunknown.c:1144:12: branch_false: ...to here
libpng-1.6.53/contrib/libtests/pngunknown.c:1151:9: acquire_memory: allocated here
libpng-1.6.53/contrib/libtests/pngunknown.c:1152:7: branch_false: following ‘false’ branch...
libpng-1.6.53/contrib/libtests/pngunknown.c:1167:8: branch_false: ...to here
libpng-1.6.53/contrib/libtests/pngunknown.c:1167:8: call_function: calling ‘check’ from ‘main’
#  669|   
#  670|      d->info_ptr = png_create_info_struct(d->png_ptr);
#  671|->    d->end_ptr = png_create_info_struct(d->png_ptr);
#  672|      if (d->info_ptr == NULL || d->end_ptr == NULL)
#  673|      {

Error: GCC_ANALYZER_WARNING (CWE-457): [#def14]
libpng-1.6.53/contrib/libtests/pngvalid.c:298:11: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘b4[2]’
libpng-1.6.53/contrib/libtests/pngvalid.c:3150:1: enter_function: entry to ‘modifier_progressive_read’
libpng-1.6.53/contrib/libtests/pngvalid.c:3178:10: branch_true: following ‘true’ branch...
libpng-1.6.53/contrib/libtests/pngvalid.c:3179:21: branch_true: ...to here
libpng-1.6.53/contrib/libtests/pngvalid.c:3181:10: branch_true: following ‘true’ branch (when ‘cb > cbAvail’)...
libpng-1.6.53/contrib/libtests/pngvalid.c:3184:13: branch_true: ...to here
libpng-1.6.53/contrib/libtests/pngvalid.c:3184:13: branch_false: following ‘false’ branch (when ‘cbAvail != 0’)...
libpng-1.6.53/contrib/libtests/pngvalid.c:3190:7: branch_false: ...to here
libpng-1.6.53/contrib/libtests/pngvalid.c:3190:7: call_function: calling ‘modifier_read_imp’ from ‘modifier_progressive_read’
#  296|      unsigned char b4[4];
#  297|      randomize_bytes(b4, sizeof b4);
#  298|->    return png_get_uint_32(b4);
#  299|   }
#  300|   #endif /* READ_FILLER || READ_RGB_TO_GRAY */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def15]
libpng-1.6.53/contrib/libtests/timepng.c:107:10: warning[-Wanalyzer-malloc-leak]: leak of ‘display’
libpng-1.6.53/contrib/libtests/timepng.c:104:17: acquire_memory: allocated here
libpng-1.6.53/contrib/libtests/timepng.c:106:10: branch_true: following ‘true’ branch...
libpng-1.6.53/contrib/libtests/timepng.c:107:10: branch_true: ...to here
libpng-1.6.53/contrib/libtests/timepng.c:107:10: throw: if ‘png_error’ throws an exception...
libpng-1.6.53/contrib/libtests/timepng.c:107:10: danger: ‘display’ leaks here; was allocated at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0)
#  105|   
#  106|         if (row == NULL || display == NULL)
#  107|->          png_error(png_ptr, "OOM allocating row buffers");
#  108|   
#  109|         {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def16]
libpng-1.6.53/contrib/libtests/timepng.c:107:10: warning[-Wanalyzer-malloc-leak]: leak of ‘row’
libpng-1.6.53/contrib/libtests/timepng.c:103:13: acquire_memory: allocated here
libpng-1.6.53/contrib/libtests/timepng.c:106:10: branch_true: following ‘true’ branch...
libpng-1.6.53/contrib/libtests/timepng.c:107:10: branch_true: ...to here
libpng-1.6.53/contrib/libtests/timepng.c:107:10: throw: if ‘png_error’ throws an exception...
libpng-1.6.53/contrib/libtests/timepng.c:107:10: danger: ‘row’ leaks here; was allocated at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#  105|   
#  106|         if (row == NULL || display == NULL)
#  107|->          png_error(png_ptr, "OOM allocating row buffers");
#  108|   
#  109|         {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def17]
libpng-1.6.53/contrib/libtests/timepng.c:110:31: warning[-Wanalyzer-malloc-leak]: leak of ‘display’
libpng-1.6.53/contrib/libtests/timepng.c:104:17: acquire_memory: allocated here
libpng-1.6.53/contrib/libtests/timepng.c:106:10: branch_false: following ‘false’ branch...
libpng-1.6.53/contrib/libtests/timepng.c:110:31: branch_false: ...to here
libpng-1.6.53/contrib/libtests/timepng.c:110:31: throw: if ‘png_get_image_height’ throws an exception...
libpng-1.6.53/contrib/libtests/timepng.c:110:31: danger: ‘display’ leaks here; was allocated at [(1)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/0)
#  108|   
#  109|         {
#  110|->          png_uint_32 height = png_get_image_height(png_ptr, info_ptr);
#  111|            int passes = png_set_interlace_handling(png_ptr);
#  112|            int pass;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def18]
libpng-1.6.53/contrib/libtests/timepng.c:110:31: warning[-Wanalyzer-malloc-leak]: leak of ‘row’
libpng-1.6.53/contrib/libtests/timepng.c:103:13: acquire_memory: allocated here
libpng-1.6.53/contrib/libtests/timepng.c:106:10: branch_false: following ‘false’ branch...
libpng-1.6.53/contrib/libtests/timepng.c:110:31: branch_false: ...to here
libpng-1.6.53/contrib/libtests/timepng.c:110:31: throw: if ‘png_get_image_height’ throws an exception...
libpng-1.6.53/contrib/libtests/timepng.c:110:31: danger: ‘row’ leaks here; was allocated at [(1)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/0)
#  108|   
#  109|         {
#  110|->          png_uint_32 height = png_get_image_height(png_ptr, info_ptr);
#  111|            int passes = png_set_interlace_handling(png_ptr);
#  112|            int pass;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def19]
libpng-1.6.53/contrib/libtests/timepng.c:111:23: warning[-Wanalyzer-malloc-leak]: leak of ‘display’
libpng-1.6.53/contrib/libtests/timepng.c:104:17: acquire_memory: allocated here
libpng-1.6.53/contrib/libtests/timepng.c:106:10: branch_false: following ‘false’ branch...
libpng-1.6.53/contrib/libtests/timepng.c:110:31: branch_false: ...to here
libpng-1.6.53/contrib/libtests/timepng.c:111:23: throw: if ‘png_set_interlace_handling’ throws an exception...
libpng-1.6.53/contrib/libtests/timepng.c:111:23: danger: ‘display’ leaks here; was allocated at [(1)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/0)
#  109|         {
#  110|            png_uint_32 height = png_get_image_height(png_ptr, info_ptr);
#  111|->          int passes = png_set_interlace_handling(png_ptr);
#  112|            int pass;
#  113|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def20]
libpng-1.6.53/contrib/libtests/timepng.c:111:23: warning[-Wanalyzer-malloc-leak]: leak of ‘row’
libpng-1.6.53/contrib/libtests/timepng.c:103:13: acquire_memory: allocated here
libpng-1.6.53/contrib/libtests/timepng.c:106:10: branch_false: following ‘false’ branch...
libpng-1.6.53/contrib/libtests/timepng.c:110:31: branch_false: ...to here
libpng-1.6.53/contrib/libtests/timepng.c:111:23: throw: if ‘png_set_interlace_handling’ throws an exception...
libpng-1.6.53/contrib/libtests/timepng.c:111:23: danger: ‘row’ leaks here; was allocated at [(1)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/0)
#  109|         {
#  110|            png_uint_32 height = png_get_image_height(png_ptr, info_ptr);
#  111|->          int passes = png_set_interlace_handling(png_ptr);
#  112|            int pass;
#  113|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def21]
libpng-1.6.53/contrib/libtests/timepng.c:114:10: warning[-Wanalyzer-malloc-leak]: leak of ‘display’
libpng-1.6.53/contrib/libtests/timepng.c:104:17: acquire_memory: allocated here
libpng-1.6.53/contrib/libtests/timepng.c:106:10: branch_false: following ‘false’ branch...
libpng-1.6.53/contrib/libtests/timepng.c:110:31: branch_false: ...to here
libpng-1.6.53/contrib/libtests/timepng.c:114:10: throw: if ‘png_start_read_image’ throws an exception...
libpng-1.6.53/contrib/libtests/timepng.c:114:10: danger: ‘display’ leaks here; was allocated at [(1)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/0)
#  112|            int pass;
#  113|   
#  114|->          png_start_read_image(png_ptr);
#  115|   
#  116|            for (pass = 0; pass < passes; ++pass)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def22]
libpng-1.6.53/contrib/libtests/timepng.c:114:10: warning[-Wanalyzer-malloc-leak]: leak of ‘row’
libpng-1.6.53/contrib/libtests/timepng.c:103:13: acquire_memory: allocated here
libpng-1.6.53/contrib/libtests/timepng.c:106:10: branch_false: following ‘false’ branch...
libpng-1.6.53/contrib/libtests/timepng.c:110:31: branch_false: ...to here
libpng-1.6.53/contrib/libtests/timepng.c:114:10: throw: if ‘png_start_read_image’ throws an exception...
libpng-1.6.53/contrib/libtests/timepng.c:114:10: danger: ‘row’ leaks here; was allocated at [(1)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/0)
#  112|            int pass;
#  113|   
#  114|->          png_start_read_image(png_ptr);
#  115|   
#  116|            for (pass = 0; pass < passes; ++pass)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def23]
libpng-1.6.53/contrib/libtests/timepng.c:125:16: warning[-Wanalyzer-malloc-leak]: leak of ‘display’
libpng-1.6.53/contrib/libtests/timepng.c:104:17: acquire_memory: allocated here
libpng-1.6.53/contrib/libtests/timepng.c:106:10: branch_false: following ‘false’ branch...
libpng-1.6.53/contrib/libtests/timepng.c:110:31: branch_false: ...to here
libpng-1.6.53/contrib/libtests/timepng.c:116:25: branch_true: following ‘true’ branch...
libpng-1.6.53/contrib/libtests/timepng.c:116:25: branch_true: ...to here
libpng-1.6.53/contrib/libtests/timepng.c:125:16: throw: if ‘png_read_row’ throws an exception...
libpng-1.6.53/contrib/libtests/timepng.c:125:16: danger: ‘display’ leaks here; was allocated at [(1)](sarif:/runs/0/results/9/codeFlows/0/threadFlows/0/locations/0)
#  123|                */
#  124|               while (y-- > 0)
#  125|->                png_read_row(png_ptr, row, display);
#  126|            }
#  127|         }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def24]
libpng-1.6.53/contrib/libtests/timepng.c:125:16: warning[-Wanalyzer-malloc-leak]: leak of ‘row’
libpng-1.6.53/contrib/libtests/timepng.c:103:13: acquire_memory: allocated here
libpng-1.6.53/contrib/libtests/timepng.c:106:10: branch_false: following ‘false’ branch...
libpng-1.6.53/contrib/libtests/timepng.c:110:31: branch_false: ...to here
libpng-1.6.53/contrib/libtests/timepng.c:116:25: branch_true: following ‘true’ branch...
libpng-1.6.53/contrib/libtests/timepng.c:116:25: branch_true: ...to here
libpng-1.6.53/contrib/libtests/timepng.c:125:16: throw: if ‘png_read_row’ throws an exception...
libpng-1.6.53/contrib/libtests/timepng.c:125:16: danger: ‘row’ leaks here; was allocated at [(1)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/0)
#  123|                */
#  124|               while (y-- > 0)
#  125|->                png_read_row(png_ptr, row, display);
#  126|            }
#  127|         }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def25]
libpng-1.6.53/contrib/libtests/timepng.c:131:4: warning[-Wanalyzer-malloc-leak]: leak of ‘display’
libpng-1.6.53/contrib/libtests/timepng.c:104:17: acquire_memory: allocated here
libpng-1.6.53/contrib/libtests/timepng.c:106:10: branch_false: following ‘false’ branch...
libpng-1.6.53/contrib/libtests/timepng.c:110:31: branch_false: ...to here
libpng-1.6.53/contrib/libtests/timepng.c:131:4: throw: if ‘png_read_end’ throws an exception...
libpng-1.6.53/contrib/libtests/timepng.c:131:4: danger: ‘display’ leaks here; was allocated at [(1)](sarif:/runs/0/results/11/codeFlows/0/threadFlows/0/locations/0)
#  129|   
#  130|      /* Make sure to read to the end of the file: */
#  131|->    png_read_end(png_ptr, info_ptr);
#  132|   
#  133|      /* Free this up: */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def26]
libpng-1.6.53/contrib/libtests/timepng.c:131:4: warning[-Wanalyzer-malloc-leak]: leak of ‘row’
libpng-1.6.53/contrib/libtests/timepng.c:103:13: acquire_memory: allocated here
libpng-1.6.53/contrib/libtests/timepng.c:106:10: branch_false: following ‘false’ branch...
libpng-1.6.53/contrib/libtests/timepng.c:110:31: branch_false: ...to here
libpng-1.6.53/contrib/libtests/timepng.c:131:4: throw: if ‘png_read_end’ throws an exception...
libpng-1.6.53/contrib/libtests/timepng.c:131:4: danger: ‘row’ leaks here; was allocated at [(1)](sarif:/runs/0/results/10/codeFlows/0/threadFlows/0/locations/0)
#  129|   
#  130|      /* Make sure to read to the end of the file: */
#  131|->    png_read_end(png_ptr, info_ptr);
#  132|   
#  133|      /* Free this up: */

Error: GCC_ANALYZER_WARNING (CWE-775): [#def27]
libpng-1.6.53/contrib/libtests/timepng.c:147:26: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(name, "rb")’
libpng-1.6.53/contrib/libtests/timepng.c:261:12: enter_function: entry to ‘add_one_file’
libpng-1.6.53/contrib/libtests/timepng.c:263:15: acquire_resource: opened here
libpng-1.6.53/contrib/libtests/timepng.c:265:7: branch_true: following ‘true’ branch...
libpng-1.6.53/contrib/libtests/timepng.c:273:11: branch_true: ...to here
libpng-1.6.53/contrib/libtests/timepng.c:273:10: branch_false: following ‘false’ branch...
libpng-1.6.53/contrib/libtests/timepng.c:281:11: branch_false: ...to here
libpng-1.6.53/contrib/libtests/timepng.c:281:11: call_function: calling ‘read_png’ from ‘add_one_file’
#  145|   static int read_png(FILE *fp, png_int_32 transforms, FILE *write_file)
#  146|   {
#  147|->    png_structp png_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING,0,0,
#  148|            no_warnings);
#  149|      png_infop info_ptr = NULL;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def28]
libpng-1.6.53/contrib/libtests/timepng.c:147:26: warning[-Wanalyzer-file-leak]: leak of FILE ‘fp’
libpng-1.6.53/contrib/libtests/timepng.c:361:5: enter_function: entry to ‘main’
libpng-1.6.53/contrib/libtests/timepng.c:370:7: branch_true: following ‘true’ branch (when ‘argc > 2’)...
libpng-1.6.53/contrib/libtests/timepng.c:370:20: branch_true: ...to here
libpng-1.6.53/contrib/libtests/timepng.c:370:8: branch_false: following ‘false’ branch (when the strings are non-equal)...
libpng-1.6.53/contrib/libtests/timepng.c:387:12: branch_false: ...to here
libpng-1.6.53/contrib/libtests/timepng.c:387:12: branch_true: following ‘true’ branch...
libpng-1.6.53/contrib/libtests/timepng.c:389:12: acquire_resource: opened here
libpng-1.6.53/contrib/libtests/timepng.c:391:10: branch_false: following ‘false’ branch...
libpng-1.6.53/contrib/libtests/timepng.c:399:16: branch_false: ...to here
libpng-1.6.53/contrib/libtests/timepng.c:400:10: branch_false: following ‘false’ branch...
libpng-1.6.53/contrib/libtests/timepng.c:414:7: branch_false: ...to here
libpng-1.6.53/contrib/libtests/timepng.c:509:7: branch_false: following ‘false’ branch...
libpng-1.6.53/contrib/libtests/timepng.c:512:12: branch_false: ...to here
libpng-1.6.53/contrib/libtests/timepng.c:529:12: branch_false: following ‘false’ branch (when ‘nfiles != 0’)...
libpng-1.6.53/contrib/libtests/timepng.c:569:10: branch_false: ...to here
libpng-1.6.53/contrib/libtests/timepng.c:569:10: branch_true: following ‘true’ branch (when ‘nfiles > 0’)...
libpng-1.6.53/contrib/libtests/timepng.c:571:13: branch_true: ...to here
libpng-1.6.53/contrib/libtests/timepng.c:571:13: branch_false: following ‘false’ branch (when ‘assembly’ is NULL)...
libpng-1.6.53/contrib/libtests/timepng.c:589:18: branch_false: ...to here
libpng-1.6.53/contrib/libtests/timepng.c:589:18: call_function: calling ‘perform_one_test’ from ‘main’
#  145|   static int read_png(FILE *fp, png_int_32 transforms, FILE *write_file)
#  146|   {
#  147|->    png_structp png_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING,0,0,
#  148|            no_warnings);
#  149|      png_infop info_ptr = NULL;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def29]
libpng-1.6.53/contrib/libtests/timepng.c:147:26: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(name, "rb")’
libpng-1.6.53/contrib/libtests/timepng.c:261:12: enter_function: entry to ‘add_one_file’
libpng-1.6.53/contrib/libtests/timepng.c:263:15: acquire_memory: allocated here
libpng-1.6.53/contrib/libtests/timepng.c:265:7: branch_true: following ‘true’ branch...
libpng-1.6.53/contrib/libtests/timepng.c:273:11: branch_true: ...to here
libpng-1.6.53/contrib/libtests/timepng.c:273:10: branch_false: following ‘false’ branch...
libpng-1.6.53/contrib/libtests/timepng.c:281:11: branch_false: ...to here
libpng-1.6.53/contrib/libtests/timepng.c:281:11: call_function: calling ‘read_png’ from ‘add_one_file’
#  145|   static int read_png(FILE *fp, png_int_32 transforms, FILE *write_file)
#  146|   {
#  147|->    png_structp png_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING,0,0,
#  148|            no_warnings);
#  149|      png_infop info_ptr = NULL;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def30]
libpng-1.6.53/contrib/libtests/timepng.c:147:26: warning[-Wanalyzer-malloc-leak]: leak of ‘fp’
libpng-1.6.53/contrib/libtests/timepng.c:361:5: enter_function: entry to ‘main’
libpng-1.6.53/contrib/libtests/timepng.c:421:12: acquire_memory: allocated here
libpng-1.6.53/contrib/libtests/timepng.c:454:10: branch_false: following ‘false’ branch...
libpng-1.6.53/contrib/libtests/timepng.c:454:10: branch_false: ...to here
libpng-1.6.53/contrib/libtests/timepng.c:509:7: branch_false: following ‘false’ branch...
libpng-1.6.53/contrib/libtests/timepng.c:512:12: branch_false: ...to here
libpng-1.6.53/contrib/libtests/timepng.c:512:12: branch_true: following ‘true’ branch (when ‘argc > 1’)...
libpng-1.6.53/contrib/libtests/timepng.c:512:12: branch_true: ...to here
libpng-1.6.53/contrib/libtests/timepng.c:516:17: branch_true: following ‘true’ branch (when ‘argc > i’)...
libpng-1.6.53/contrib/libtests/timepng.c:518:13: branch_true: ...to here
libpng-1.6.53/contrib/libtests/timepng.c:518:13: branch_false: following ‘false’ branch (when ‘nfiles != 2147483647’)...
libpng-1.6.53/contrib/libtests/timepng.c:524:40: branch_false: ...to here
libpng-1.6.53/contrib/libtests/timepng.c:524:19: call_function: calling ‘add_one_file’ from ‘main’
#  145|   static int read_png(FILE *fp, png_int_32 transforms, FILE *write_file)
#  146|   {
#  147|->    png_structp png_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING,0,0,
#  148|            no_warnings);
#  149|      png_infop info_ptr = NULL;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def31]
libpng-1.6.53/contrib/libtests/timepng.c:154:8: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(name, "rb")’
libpng-1.6.53/contrib/libtests/timepng.c:261:12: enter_function: entry to ‘add_one_file’
libpng-1.6.53/contrib/libtests/timepng.c:263:15: acquire_resource: opened here
libpng-1.6.53/contrib/libtests/timepng.c:265:7: branch_true: following ‘true’ branch...
libpng-1.6.53/contrib/libtests/timepng.c:273:11: branch_true: ...to here
libpng-1.6.53/contrib/libtests/timepng.c:273:10: branch_false: following ‘false’ branch...
libpng-1.6.53/contrib/libtests/timepng.c:281:11: branch_false: ...to here
libpng-1.6.53/contrib/libtests/timepng.c:281:11: call_function: calling ‘read_png’ from ‘add_one_file’
#  152|         return 0;
#  153|   
#  154|->    if (setjmp(png_jmpbuf(png_ptr)))
#  155|      {
#  156|         png_destroy_read_struct(&png_ptr, &info_ptr, NULL);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def32]
libpng-1.6.53/contrib/libtests/timepng.c:154:8: warning[-Wanalyzer-file-leak]: leak of FILE ‘fp’
libpng-1.6.53/contrib/libtests/timepng.c:361:5: enter_function: entry to ‘main’
libpng-1.6.53/contrib/libtests/timepng.c:370:7: branch_true: following ‘true’ branch (when ‘argc > 2’)...
libpng-1.6.53/contrib/libtests/timepng.c:370:20: branch_true: ...to here
libpng-1.6.53/contrib/libtests/timepng.c:370:8: branch_false: following ‘false’ branch (when the strings are non-equal)...
libpng-1.6.53/contrib/libtests/timepng.c:387:12: branch_false: ...to here
libpng-1.6.53/contrib/libtests/timepng.c:387:12: branch_true: following ‘true’ branch...
libpng-1.6.53/contrib/libtests/timepng.c:389:12: acquire_resource: opened here
libpng-1.6.53/contrib/libtests/timepng.c:391:10: branch_false: following ‘false’ branch...
libpng-1.6.53/contrib/libtests/timepng.c:399:16: branch_false: ...to here
libpng-1.6.53/contrib/libtests/timepng.c:400:10: branch_false: following ‘false’ branch...
libpng-1.6.53/contrib/libtests/timepng.c:414:7: branch_false: ...to here
libpng-1.6.53/contrib/libtests/timepng.c:509:7: branch_false: following ‘false’ branch...
libpng-1.6.53/contrib/libtests/timepng.c:512:12: branch_false: ...to here
libpng-1.6.53/contrib/libtests/timepng.c:529:12: branch_false: following ‘false’ branch (when ‘nfiles != 0’)...
libpng-1.6.53/contrib/libtests/timepng.c:569:10: branch_false: ...to here
libpng-1.6.53/contrib/libtests/timepng.c:569:10: branch_true: following ‘true’ branch (when ‘nfiles > 0’)...
libpng-1.6.53/contrib/libtests/timepng.c:571:13: branch_true: ...to here
libpng-1.6.53/contrib/libtests/timepng.c:571:13: branch_false: following ‘false’ branch (when ‘assembly’ is NULL)...
libpng-1.6.53/contrib/libtests/timepng.c:589:18: branch_false: ...to here
libpng-1.6.53/contrib/libtests/timepng.c:589:18: call_function: calling ‘perform_one_test’ from ‘main’
#  152|         return 0;
#  153|   
#  154|->    if (setjmp(png_jmpbuf(png_ptr)))
#  155|      {
#  156|         png_destroy_read_struct(&png_ptr, &info_ptr, NULL);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def33]
libpng-1.6.53/contrib/libtests/timepng.c:154:8: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(name, "rb")’
libpng-1.6.53/contrib/libtests/timepng.c:261:12: enter_function: entry to ‘add_one_file’
libpng-1.6.53/contrib/libtests/timepng.c:263:15: acquire_memory: allocated here
libpng-1.6.53/contrib/libtests/timepng.c:265:7: branch_true: following ‘true’ branch...
libpng-1.6.53/contrib/libtests/timepng.c:273:11: branch_true: ...to here
libpng-1.6.53/contrib/libtests/timepng.c:273:10: branch_false: following ‘false’ branch...
libpng-1.6.53/contrib/libtests/timepng.c:281:11: branch_false: ...to here
libpng-1.6.53/contrib/libtests/timepng.c:281:11: call_function: calling ‘read_png’ from ‘add_one_file’
#  152|         return 0;
#  153|   
#  154|->    if (setjmp(png_jmpbuf(png_ptr)))
#  155|      {
#  156|         png_destroy_read_struct(&png_ptr, &info_ptr, NULL);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def34]
libpng-1.6.53/contrib/libtests/timepng.c:154:8: warning[-Wanalyzer-malloc-leak]: leak of ‘fp’
libpng-1.6.53/contrib/libtests/timepng.c:361:5: enter_function: entry to ‘main’
libpng-1.6.53/contrib/libtests/timepng.c:421:12: acquire_memory: allocated here
libpng-1.6.53/contrib/libtests/timepng.c:454:10: branch_false: following ‘false’ branch...
libpng-1.6.53/contrib/libtests/timepng.c:454:10: branch_false: ...to here
libpng-1.6.53/contrib/libtests/timepng.c:509:7: branch_false: following ‘false’ branch...
libpng-1.6.53/contrib/libtests/timepng.c:512:12: branch_false: ...to here
libpng-1.6.53/contrib/libtests/timepng.c:512:12: branch_true: following ‘true’ branch (when ‘argc > 1’)...
libpng-1.6.53/contrib/libtests/timepng.c:512:12: branch_true: ...to here
libpng-1.6.53/contrib/libtests/timepng.c:516:17: branch_true: following ‘true’ branch (when ‘argc > i’)...
libpng-1.6.53/contrib/libtests/timepng.c:518:13: branch_true: ...to here
libpng-1.6.53/contrib/libtests/timepng.c:518:13: branch_false: following ‘false’ branch (when ‘nfiles != 2147483647’)...
libpng-1.6.53/contrib/libtests/timepng.c:524:40: branch_false: ...to here
libpng-1.6.53/contrib/libtests/timepng.c:524:19: call_function: calling ‘add_one_file’ from ‘main’
#  152|         return 0;
#  153|   
#  154|->    if (setjmp(png_jmpbuf(png_ptr)))
#  155|      {
#  156|         png_destroy_read_struct(&png_ptr, &info_ptr, NULL);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def35]
libpng-1.6.53/contrib/libtests/timepng.c:161:7: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(name, "rb")’
libpng-1.6.53/contrib/libtests/timepng.c:261:12: enter_function: entry to ‘add_one_file’
libpng-1.6.53/contrib/libtests/timepng.c:263:15: acquire_resource: opened here
libpng-1.6.53/contrib/libtests/timepng.c:265:7: branch_true: following ‘true’ branch...
libpng-1.6.53/contrib/libtests/timepng.c:273:11: branch_true: ...to here
libpng-1.6.53/contrib/libtests/timepng.c:273:10: branch_false: following ‘false’ branch...
libpng-1.6.53/contrib/libtests/timepng.c:281:11: branch_false: ...to here
libpng-1.6.53/contrib/libtests/timepng.c:281:11: call_function: calling ‘read_png’ from ‘add_one_file’
#  159|   
#  160|   #  ifdef PNG_BENIGN_ERRORS_SUPPORTED
#  161|->       png_set_benign_errors(png_ptr, 1/*allowed*/);
#  162|   #  endif
#  163|      png_init_io(png_ptr, fp);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def36]
libpng-1.6.53/contrib/libtests/timepng.c:161:7: warning[-Wanalyzer-file-leak]: leak of FILE ‘fp’
libpng-1.6.53/contrib/libtests/timepng.c:361:5: enter_function: entry to ‘main’
libpng-1.6.53/contrib/libtests/timepng.c:370:7: branch_true: following ‘true’ branch (when ‘argc > 2’)...
libpng-1.6.53/contrib/libtests/timepng.c:370:20: branch_true: ...to here
libpng-1.6.53/contrib/libtests/timepng.c:370:8: branch_false: following ‘false’ branch (when the strings are non-equal)...
libpng-1.6.53/contrib/libtests/timepng.c:387:12: branch_false: ...to here
libpng-1.6.53/contrib/libtests/timepng.c:387:12: branch_true: following ‘true’ branch...
libpng-1.6.53/contrib/libtests/timepng.c:389:12: acquire_resource: opened here
libpng-1.6.53/contrib/libtests/timepng.c:391:10: branch_false: following ‘false’ branch...
libpng-1.6.53/contrib/libtests/timepng.c:399:16: branch_false: ...to here
libpng-1.6.53/contrib/libtests/timepng.c:400:10: branch_false: following ‘false’ branch...
libpng-1.6.53/contrib/libtests/timepng.c:414:7: branch_false: ...to here
libpng-1.6.53/contrib/libtests/timepng.c:509:7: branch_false: following ‘false’ branch...
libpng-1.6.53/contrib/libtests/timepng.c:512:12: branch_false: ...to here
libpng-1.6.53/contrib/libtests/timepng.c:529:12: branch_false: following ‘false’ branch (when ‘nfiles != 0’)...
libpng-1.6.53/contrib/libtests/timepng.c:569:10: branch_false: ...to here
libpng-1.6.53/contrib/libtests/timepng.c:569:10: branch_true: following ‘true’ branch (when ‘nfiles > 0’)...
libpng-1.6.53/contrib/libtests/timepng.c:571:13: branch_true: ...to here
libpng-1.6.53/contrib/libtests/timepng.c:571:13: branch_false: following ‘false’ branch (when ‘assembly’ is NULL)...
libpng-1.6.53/contrib/libtests/timepng.c:589:18: branch_false: ...to here
libpng-1.6.53/contrib/libtests/timepng.c:589:18: call_function: calling ‘perform_one_test’ from ‘main’
#  159|   
#  160|   #  ifdef PNG_BENIGN_ERRORS_SUPPORTED
#  161|->       png_set_benign_errors(png_ptr, 1/*allowed*/);
#  162|   #  endif
#  163|      png_init_io(png_ptr, fp);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def37]
libpng-1.6.53/contrib/libtests/timepng.c:161:7: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(name, "rb")’
libpng-1.6.53/contrib/libtests/timepng.c:261:12: enter_function: entry to ‘add_one_file’
libpng-1.6.53/contrib/libtests/timepng.c:263:15: acquire_memory: allocated here
libpng-1.6.53/contrib/libtests/timepng.c:265:7: branch_true: following ‘true’ branch...
libpng-1.6.53/contrib/libtests/timepng.c:273:11: branch_true: ...to here
libpng-1.6.53/contrib/libtests/timepng.c:273:10: branch_false: following ‘false’ branch...
libpng-1.6.53/contrib/libtests/timepng.c:281:11: branch_false: ...to here
libpng-1.6.53/contrib/libtests/timepng.c:281:11: call_function: calling ‘read_png’ from ‘add_one_file’
#  159|   
#  160|   #  ifdef PNG_BENIGN_ERRORS_SUPPORTED
#  161|->       png_set_benign_errors(png_ptr, 1/*allowed*/);
#  162|   #  endif
#  163|      png_init_io(png_ptr, fp);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def38]
libpng-1.6.53/contrib/libtests/timepng.c:161:7: warning[-Wanalyzer-malloc-leak]: leak of ‘fp’
libpng-1.6.53/contrib/libtests/timepng.c:361:5: enter_function: entry to ‘main’
libpng-1.6.53/contrib/libtests/timepng.c:421:12: acquire_memory: allocated here
libpng-1.6.53/contrib/libtests/timepng.c:454:10: branch_false: following ‘false’ branch...
libpng-1.6.53/contrib/libtests/timepng.c:454:10: branch_false: ...to here
libpng-1.6.53/contrib/libtests/timepng.c:509:7: branch_false: following ‘false’ branch...
libpng-1.6.53/contrib/libtests/timepng.c:512:12: branch_false: ...to here
libpng-1.6.53/contrib/libtests/timepng.c:512:12: branch_true: following ‘true’ branch (when ‘argc > 1’)...
libpng-1.6.53/contrib/libtests/timepng.c:512:12: branch_true: ...to here
libpng-1.6.53/contrib/libtests/timepng.c:516:17: branch_true: following ‘true’ branch (when ‘argc > i’)...
libpng-1.6.53/contrib/libtests/timepng.c:518:13: branch_true: ...to here
libpng-1.6.53/contrib/libtests/timepng.c:518:13: branch_false: following ‘false’ branch (when ‘nfiles != 2147483647’)...
libpng-1.6.53/contrib/libtests/timepng.c:524:40: branch_false: ...to here
libpng-1.6.53/contrib/libtests/timepng.c:524:19: call_function: calling ‘add_one_file’ from ‘main’
#  159|   
#  160|   #  ifdef PNG_BENIGN_ERRORS_SUPPORTED
#  161|->       png_set_benign_errors(png_ptr, 1/*allowed*/);
#  162|   #  endif
#  163|      png_init_io(png_ptr, fp);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def39]
libpng-1.6.53/contrib/libtests/timepng.c:163:4: warning[-Wanalyzer-file-leak]: leak of FILE ‘fp’
libpng-1.6.53/contrib/libtests/timepng.c:361:5: enter_function: entry to ‘main’
libpng-1.6.53/contrib/libtests/timepng.c:370:7: branch_true: following ‘true’ branch (when ‘argc > 2’)...
libpng-1.6.53/contrib/libtests/timepng.c:370:20: branch_true: ...to here
libpng-1.6.53/contrib/libtests/timepng.c:370:8: branch_false: following ‘false’ branch (when the strings are non-equal)...
libpng-1.6.53/contrib/libtests/timepng.c:387:12: branch_false: ...to here
libpng-1.6.53/contrib/libtests/timepng.c:387:12: branch_true: following ‘true’ branch...
libpng-1.6.53/contrib/libtests/timepng.c:389:12: acquire_resource: opened here
libpng-1.6.53/contrib/libtests/timepng.c:391:10: branch_false: following ‘false’ branch...
libpng-1.6.53/contrib/libtests/timepng.c:399:16: branch_false: ...to here
libpng-1.6.53/contrib/libtests/timepng.c:400:10: branch_false: following ‘false’ branch...
libpng-1.6.53/contrib/libtests/timepng.c:414:7: branch_false: ...to here
libpng-1.6.53/contrib/libtests/timepng.c:509:7: branch_false: following ‘false’ branch...
libpng-1.6.53/contrib/libtests/timepng.c:512:12: branch_false: ...to here
libpng-1.6.53/contrib/libtests/timepng.c:529:12: branch_false: following ‘false’ branch (when ‘nfiles != 0’)...
libpng-1.6.53/contrib/libtests/timepng.c:569:10: branch_false: ...to here
libpng-1.6.53/contrib/libtests/timepng.c:569:10: branch_true: following ‘true’ branch (when ‘nfiles > 0’)...
libpng-1.6.53/contrib/libtests/timepng.c:571:13: branch_true: ...to here
libpng-1.6.53/contrib/libtests/timepng.c:571:13: branch_false: following ‘false’ branch (when ‘assembly’ is NULL)...
libpng-1.6.53/contrib/libtests/timepng.c:589:18: branch_false: ...to here
libpng-1.6.53/contrib/libtests/timepng.c:589:18: call_function: calling ‘perform_one_test’ from ‘main’
#  161|         png_set_benign_errors(png_ptr, 1/*allowed*/);
#  162|   #  endif
#  163|->    png_init_io(png_ptr, fp);
#  164|   
#  165|      info_ptr = png_create_info_struct(png_ptr);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def40]
libpng-1.6.53/contrib/libtests/timepng.c:163:4: warning[-Wanalyzer-malloc-leak]: leak of ‘fp’
libpng-1.6.53/contrib/libtests/timepng.c:361:5: enter_function: entry to ‘main’
libpng-1.6.53/contrib/libtests/timepng.c:421:12: acquire_memory: allocated here
libpng-1.6.53/contrib/libtests/timepng.c:454:10: branch_false: following ‘false’ branch...
libpng-1.6.53/contrib/libtests/timepng.c:454:10: branch_false: ...to here
libpng-1.6.53/contrib/libtests/timepng.c:509:7: branch_false: following ‘false’ branch...
libpng-1.6.53/contrib/libtests/timepng.c:512:12: branch_false: ...to here
libpng-1.6.53/contrib/libtests/timepng.c:512:12: branch_true: following ‘true’ branch (when ‘argc > 1’)...
libpng-1.6.53/contrib/libtests/timepng.c:512:12: branch_true: ...to here
libpng-1.6.53/contrib/libtests/timepng.c:516:17: branch_true: following ‘true’ branch (when ‘argc > i’)...
libpng-1.6.53/contrib/libtests/timepng.c:518:13: branch_true: ...to here
libpng-1.6.53/contrib/libtests/timepng.c:518:13: branch_false: following ‘false’ branch (when ‘nfiles != 2147483647’)...
libpng-1.6.53/contrib/libtests/timepng.c:524:40: branch_false: ...to here
libpng-1.6.53/contrib/libtests/timepng.c:524:19: call_function: calling ‘add_one_file’ from ‘main’
#  161|         png_set_benign_errors(png_ptr, 1/*allowed*/);
#  162|   #  endif
#  163|->    png_init_io(png_ptr, fp);
#  164|   
#  165|      info_ptr = png_create_info_struct(png_ptr);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def41]
libpng-1.6.53/contrib/libtests/timepng.c:165:15: warning[-Wanalyzer-malloc-leak]: leak of ‘fp’
libpng-1.6.53/contrib/libtests/timepng.c:361:5: enter_function: entry to ‘main’
libpng-1.6.53/contrib/libtests/timepng.c:421:12: acquire_memory: allocated here
libpng-1.6.53/contrib/libtests/timepng.c:454:10: branch_false: following ‘false’ branch...
libpng-1.6.53/contrib/libtests/timepng.c:454:10: branch_false: ...to here
libpng-1.6.53/contrib/libtests/timepng.c:509:7: branch_false: following ‘false’ branch...
libpng-1.6.53/contrib/libtests/timepng.c:512:12: branch_false: ...to here
libpng-1.6.53/contrib/libtests/timepng.c:512:12: branch_true: following ‘true’ branch (when ‘argc > 1’)...
libpng-1.6.53/contrib/libtests/timepng.c:512:12: branch_true: ...to here
libpng-1.6.53/contrib/libtests/timepng.c:516:17: branch_true: following ‘true’ branch (when ‘argc > i’)...
libpng-1.6.53/contrib/libtests/timepng.c:518:13: branch_true: ...to here
libpng-1.6.53/contrib/libtests/timepng.c:518:13: branch_false: following ‘false’ branch (when ‘nfiles != 2147483647’)...
libpng-1.6.53/contrib/libtests/timepng.c:524:40: branch_false: ...to here
libpng-1.6.53/contrib/libtests/timepng.c:524:19: call_function: calling ‘add_one_file’ from ‘main’
#  163|      png_init_io(png_ptr, fp);
#  164|   
#  165|->    info_ptr = png_create_info_struct(png_ptr);
#  166|   
#  167|      if (info_ptr == NULL)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def42]
libpng-1.6.53/contrib/libtests/timepng.c:168:7: warning[-Wanalyzer-malloc-leak]: leak of ‘fp’
libpng-1.6.53/contrib/libtests/timepng.c:361:5: enter_function: entry to ‘main’
libpng-1.6.53/contrib/libtests/timepng.c:421:12: acquire_memory: allocated here
libpng-1.6.53/contrib/libtests/timepng.c:454:10: branch_false: following ‘false’ branch...
libpng-1.6.53/contrib/libtests/timepng.c:454:10: branch_false: ...to here
libpng-1.6.53/contrib/libtests/timepng.c:509:7: branch_false: following ‘false’ branch...
libpng-1.6.53/contrib/libtests/timepng.c:512:12: branch_false: ...to here
libpng-1.6.53/contrib/libtests/timepng.c:512:12: branch_true: following ‘true’ branch (when ‘argc > 1’)...
libpng-1.6.53/contrib/libtests/timepng.c:512:12: branch_true: ...to here
libpng-1.6.53/contrib/libtests/timepng.c:516:17: branch_true: following ‘true’ branch (when ‘argc > i’)...
libpng-1.6.53/contrib/libtests/timepng.c:518:13: branch_true: ...to here
libpng-1.6.53/contrib/libtests/timepng.c:518:13: branch_false: following ‘false’ branch (when ‘nfiles != 2147483647’)...
libpng-1.6.53/contrib/libtests/timepng.c:524:40: branch_false: ...to here
libpng-1.6.53/contrib/libtests/timepng.c:524:19: call_function: calling ‘add_one_file’ from ‘main’
#  166|   
#  167|      if (info_ptr == NULL)
#  168|->       png_error(png_ptr, "OOM allocating info structure");
#  169|   
#  170|      if (transforms < 0)

Error: GCC_ANALYZER_WARNING (CWE-775): [#def43]
libpng-1.6.53/contrib/libtests/timepng.c:186:4: warning[-Wanalyzer-file-leak]: leak of FILE ‘fp’
libpng-1.6.53/contrib/libtests/timepng.c:361:5: enter_function: entry to ‘main’
libpng-1.6.53/contrib/libtests/timepng.c:370:7: branch_true: following ‘true’ branch (when ‘argc > 2’)...
libpng-1.6.53/contrib/libtests/timepng.c:370:20: branch_true: ...to here
libpng-1.6.53/contrib/libtests/timepng.c:370:8: branch_false: following ‘false’ branch (when the strings are non-equal)...
libpng-1.6.53/contrib/libtests/timepng.c:387:12: branch_false: ...to here
libpng-1.6.53/contrib/libtests/timepng.c:387:12: branch_true: following ‘true’ branch...
libpng-1.6.53/contrib/libtests/timepng.c:389:12: acquire_resource: opened here
libpng-1.6.53/contrib/libtests/timepng.c:391:10: branch_false: following ‘false’ branch...
libpng-1.6.53/contrib/libtests/timepng.c:399:16: branch_false: ...to here
libpng-1.6.53/contrib/libtests/timepng.c:400:10: branch_false: following ‘false’ branch...
libpng-1.6.53/contrib/libtests/timepng.c:414:7: branch_false: ...to here
libpng-1.6.53/contrib/libtests/timepng.c:509:7: branch_false: following ‘false’ branch...
libpng-1.6.53/contrib/libtests/timepng.c:512:12: branch_false: ...to here
libpng-1.6.53/contrib/libtests/timepng.c:529:12: branch_false: following ‘false’ branch (when ‘nfiles != 0’)...
libpng-1.6.53/contrib/libtests/timepng.c:569:10: branch_false: ...to here
libpng-1.6.53/contrib/libtests/timepng.c:569:10: branch_true: following ‘true’ branch (when ‘nfiles > 0’)...
libpng-1.6.53/contrib/libtests/timepng.c:571:13: branch_true: ...to here
libpng-1.6.53/contrib/libtests/timepng.c:571:13: branch_false: following ‘false’ branch (when ‘assembly’ is NULL)...
libpng-1.6.53/contrib/libtests/timepng.c:589:18: branch_false: ...to here
libpng-1.6.53/contrib/libtests/timepng.c:589:18: call_function: calling ‘perform_one_test’ from ‘main’
#  184|         return 1;
#  185|   
#  186|->    perror("CLOCK_PROCESS_CPUTIME_ID");
#  187|      fprintf(stderr, "timepng: could not get the time\n");
#  188|      return 0;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def44]
libpng-1.6.53/contrib/libtests/timepng.c:186:4: warning[-Wanalyzer-malloc-leak]: leak of ‘fp’
libpng-1.6.53/contrib/libtests/timepng.c:361:5: enter_function: entry to ‘main’
libpng-1.6.53/contrib/libtests/timepng.c:370:7: branch_true: following ‘true’ branch (when ‘argc > 2’)...
libpng-1.6.53/contrib/libtests/timepng.c:370:20: branch_true: ...to here
libpng-1.6.53/contrib/libtests/timepng.c:370:8: branch_false: following ‘false’ branch (when the strings are non-equal)...
libpng-1.6.53/contrib/libtests/timepng.c:387:12: branch_false: ...to here
libpng-1.6.53/contrib/libtests/timepng.c:387:12: branch_true: following ‘true’ branch...
libpng-1.6.53/contrib/libtests/timepng.c:389:12: acquire_memory: allocated here
libpng-1.6.53/contrib/libtests/timepng.c:391:10: branch_false: following ‘false’ branch...
libpng-1.6.53/contrib/libtests/timepng.c:399:16: branch_false: ...to here
libpng-1.6.53/contrib/libtests/timepng.c:400:10: branch_false: following ‘false’ branch...
libpng-1.6.53/contrib/libtests/timepng.c:414:7: branch_false: ...to here
libpng-1.6.53/contrib/libtests/timepng.c:509:7: branch_false: following ‘false’ branch...
libpng-1.6.53/contrib/libtests/timepng.c:512:12: branch_false: ...to here
libpng-1.6.53/contrib/libtests/timepng.c:529:12: branch_false: following ‘false’ branch (when ‘nfiles != 0’)...
libpng-1.6.53/contrib/libtests/timepng.c:569:10: branch_false: ...to here
libpng-1.6.53/contrib/libtests/timepng.c:569:10: branch_true: following ‘true’ branch (when ‘nfiles > 0’)...
libpng-1.6.53/contrib/libtests/timepng.c:571:13: branch_true: ...to here
libpng-1.6.53/contrib/libtests/timepng.c:571:13: branch_false: following ‘false’ branch (when ‘assembly’ is NULL)...
libpng-1.6.53/contrib/libtests/timepng.c:589:18: branch_false: ...to here
libpng-1.6.53/contrib/libtests/timepng.c:589:18: call_function: calling ‘perform_one_test’ from ‘main’
#  184|         return 1;
#  185|   
#  186|->    perror("CLOCK_PROCESS_CPUTIME_ID");
#  187|      fprintf(stderr, "timepng: could not get the time\n");
#  188|      return 0;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def45]
libpng-1.6.53/contrib/libtests/timepng.c:197:4: warning[-Wanalyzer-file-leak]: leak of FILE ‘fp’
libpng-1.6.53/contrib/libtests/timepng.c:361:5: enter_function: entry to ‘main’
libpng-1.6.53/contrib/libtests/timepng.c:370:7: branch_true: following ‘true’ branch (when ‘argc > 2’)...
libpng-1.6.53/contrib/libtests/timepng.c:370:20: branch_true: ...to here
libpng-1.6.53/contrib/libtests/timepng.c:370:8: branch_false: following ‘false’ branch (when the strings are non-equal)...
libpng-1.6.53/contrib/libtests/timepng.c:387:12: branch_false: ...to here
libpng-1.6.53/contrib/libtests/timepng.c:387:12: branch_true: following ‘true’ branch...
libpng-1.6.53/contrib/libtests/timepng.c:389:12: acquire_resource: opened here
libpng-1.6.53/contrib/libtests/timepng.c:391:10: branch_false: following ‘false’ branch...
libpng-1.6.53/contrib/libtests/timepng.c:399:16: branch_false: ...to here
libpng-1.6.53/contrib/libtests/timepng.c:400:10: branch_false: following ‘false’ branch...
libpng-1.6.53/contrib/libtests/timepng.c:414:7: branch_false: ...to here
libpng-1.6.53/contrib/libtests/timepng.c:509:7: branch_false: following ‘false’ branch...
libpng-1.6.53/contrib/libtests/timepng.c:512:12: branch_false: ...to here
libpng-1.6.53/contrib/libtests/timepng.c:529:12: branch_false: following ‘false’ branch (when ‘nfiles != 0’)...
libpng-1.6.53/contrib/libtests/timepng.c:569:10: branch_false: ...to here
libpng-1.6.53/contrib/libtests/timepng.c:569:10: branch_true: following ‘true’ branch (when ‘nfiles > 0’)...
libpng-1.6.53/contrib/libtests/timepng.c:571:13: branch_true: ...to here
libpng-1.6.53/contrib/libtests/timepng.c:571:13: branch_false: following ‘false’ branch (when ‘assembly’ is NULL)...
libpng-1.6.53/contrib/libtests/timepng.c:589:18: branch_false: ...to here
libpng-1.6.53/contrib/libtests/timepng.c:589:18: call_function: calling ‘perform_one_test’ from ‘main’
#  195|   
#  196|      /* Clear out all errors: */
#  197|->    rewind(fp);
#  198|   
#  199|      if (mytime(&before))

Error: GCC_ANALYZER_WARNING (CWE-401): [#def46]
libpng-1.6.53/contrib/libtests/timepng.c:197:4: warning[-Wanalyzer-malloc-leak]: leak of ‘fp’
libpng-1.6.53/contrib/libtests/timepng.c:361:5: enter_function: entry to ‘main’
libpng-1.6.53/contrib/libtests/timepng.c:370:7: branch_true: following ‘true’ branch (when ‘argc > 2’)...
libpng-1.6.53/contrib/libtests/timepng.c:370:20: branch_true: ...to here
libpng-1.6.53/contrib/libtests/timepng.c:370:8: branch_false: following ‘false’ branch (when the strings are non-equal)...
libpng-1.6.53/contrib/libtests/timepng.c:387:12: branch_false: ...to here
libpng-1.6.53/contrib/libtests/timepng.c:387:12: branch_true: following ‘true’ branch...
libpng-1.6.53/contrib/libtests/timepng.c:389:12: acquire_memory: allocated here
libpng-1.6.53/contrib/libtests/timepng.c:391:10: branch_false: following ‘false’ branch...
libpng-1.6.53/contrib/libtests/timepng.c:399:16: branch_false: ...to here
libpng-1.6.53/contrib/libtests/timepng.c:400:10: branch_false: following ‘false’ branch...
libpng-1.6.53/contrib/libtests/timepng.c:414:7: branch_false: ...to here
libpng-1.6.53/contrib/libtests/timepng.c:509:7: branch_false: following ‘false’ branch...
libpng-1.6.53/contrib/libtests/timepng.c:512:12: branch_false: ...to here
libpng-1.6.53/contrib/libtests/timepng.c:529:12: branch_false: following ‘false’ branch (when ‘nfiles != 0’)...
libpng-1.6.53/contrib/libtests/timepng.c:569:10: branch_false: ...to here
libpng-1.6.53/contrib/libtests/timepng.c:569:10: branch_true: following ‘true’ branch (when ‘nfiles > 0’)...
libpng-1.6.53/contrib/libtests/timepng.c:571:13: branch_true: ...to here
libpng-1.6.53/contrib/libtests/timepng.c:571:13: branch_false: following ‘false’ branch (when ‘assembly’ is NULL)...
libpng-1.6.53/contrib/libtests/timepng.c:589:18: branch_false: ...to here
libpng-1.6.53/contrib/libtests/timepng.c:589:18: call_function: calling ‘perform_one_test’ from ‘main’
#  195|   
#  196|      /* Clear out all errors: */
#  197|->    rewind(fp);
#  198|   
#  199|      if (mytime(&before))

Error: GCC_ANALYZER_WARNING (CWE-775): [#def47]
libpng-1.6.53/contrib/libtests/timepng.c:273:10: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(name, "rb")’
libpng-1.6.53/contrib/libtests/timepng.c:263:15: acquire_resource: opened here
libpng-1.6.53/contrib/libtests/timepng.c:265:7: branch_true: following ‘true’ branch...
libpng-1.6.53/contrib/libtests/timepng.c:273:11: branch_true: ...to here
libpng-1.6.53/contrib/libtests/timepng.c:273:10: danger: ‘fopen(name, "rb")’ leaks here; was opened at [(1)](sarif:/runs/0/results/34/codeFlows/0/threadFlows/0/locations/0)
#  271|         fpos_t pos;
#  272|   
#  273|->       if (fgetpos(fp, &pos))
#  274|         {
#  275|            /* Fatal error reading the start: */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def48]
libpng-1.6.53/contrib/libtests/timepng.c:273:10: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(name, "rb")’
libpng-1.6.53/contrib/libtests/timepng.c:263:15: acquire_memory: allocated here
libpng-1.6.53/contrib/libtests/timepng.c:265:7: branch_true: following ‘true’ branch...
libpng-1.6.53/contrib/libtests/timepng.c:273:11: branch_true: ...to here
libpng-1.6.53/contrib/libtests/timepng.c:273:10: danger: ‘fopen(name, "rb")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/35/codeFlows/0/threadFlows/0/locations/0)
#  271|         fpos_t pos;
#  272|   
#  273|->       if (fgetpos(fp, &pos))
#  274|         {
#  275|            /* Fatal error reading the start: */

Error: GCC_ANALYZER_WARNING (CWE-775): [#def49]
libpng-1.6.53/contrib/libtests/timepng.c:273:11: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(name, "rb")’
libpng-1.6.53/contrib/libtests/timepng.c:263:15: acquire_resource: opened here
libpng-1.6.53/contrib/libtests/timepng.c:265:7: branch_true: following ‘true’ branch...
libpng-1.6.53/contrib/libtests/timepng.c:273:11: branch_true: ...to here
libpng-1.6.53/contrib/libtests/timepng.c:273:11: throw: if ‘fgetpos’ throws an exception...
libpng-1.6.53/contrib/libtests/timepng.c:273:11: danger: ‘fopen(name, "rb")’ leaks here; was opened at [(1)](sarif:/runs/0/results/36/codeFlows/0/threadFlows/0/locations/0)
#  271|         fpos_t pos;
#  272|   
#  273|->       if (fgetpos(fp, &pos))
#  274|         {
#  275|            /* Fatal error reading the start: */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def50]
libpng-1.6.53/contrib/libtests/timepng.c:273:11: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(name, "rb")’
libpng-1.6.53/contrib/libtests/timepng.c:263:15: acquire_memory: allocated here
libpng-1.6.53/contrib/libtests/timepng.c:265:7: branch_true: following ‘true’ branch...
libpng-1.6.53/contrib/libtests/timepng.c:273:11: branch_true: ...to here
libpng-1.6.53/contrib/libtests/timepng.c:273:11: throw: if ‘fgetpos’ throws an exception...
libpng-1.6.53/contrib/libtests/timepng.c:273:11: danger: ‘fopen(name, "rb")’ leaks here; was allocated at [(1)](sarif:/runs/0/results/38/codeFlows/0/threadFlows/0/locations/0)
#  271|         fpos_t pos;
#  272|   
#  273|->       if (fgetpos(fp, &pos))
#  274|         {
#  275|            /* Fatal error reading the start: */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def51]
libpng-1.6.53/contrib/libtests/timepng.c:273:11: warning[-Wanalyzer-malloc-leak]: leak of ‘fp’
libpng-1.6.53/contrib/libtests/timepng.c:361:5: enter_function: entry to ‘main’
libpng-1.6.53/contrib/libtests/timepng.c:421:12: acquire_memory: allocated here
libpng-1.6.53/contrib/libtests/timepng.c:454:10: branch_false: following ‘false’ branch...
libpng-1.6.53/contrib/libtests/timepng.c:454:10: branch_false: ...to here
libpng-1.6.53/contrib/libtests/timepng.c:509:7: branch_false: following ‘false’ branch...
libpng-1.6.53/contrib/libtests/timepng.c:512:12: branch_false: ...to here
libpng-1.6.53/contrib/libtests/timepng.c:512:12: branch_true: following ‘true’ branch (when ‘argc > 1’)...
libpng-1.6.53/contrib/libtests/timepng.c:512:12: branch_true: ...to here
libpng-1.6.53/contrib/libtests/timepng.c:516:17: branch_true: following ‘true’ branch (when ‘argc > i’)...
libpng-1.6.53/contrib/libtests/timepng.c:518:13: branch_true: ...to here
libpng-1.6.53/contrib/libtests/timepng.c:518:13: branch_false: following ‘false’ branch (when ‘nfiles != 2147483647’)...
libpng-1.6.53/contrib/libtests/timepng.c:524:40: branch_false: ...to here
libpng-1.6.53/contrib/libtests/timepng.c:524:19: call_function: calling ‘add_one_file’ from ‘main’
#  271|         fpos_t pos;
#  272|   
#  273|->       if (fgetpos(fp, &pos))
#  274|         {
#  275|            /* Fatal error reading the start: */

Error: GCC_ANALYZER_WARNING (CWE-401): [#def52]
libpng-1.6.53/contrib/libtests/timepng.c:276:10: warning[-Wanalyzer-malloc-leak]: leak of ‘fp’
libpng-1.6.53/contrib/libtests/timepng.c:361:5: enter_function: entry to ‘main’
libpng-1.6.53/contrib/libtests/timepng.c:421:12: acquire_memory: allocated here
libpng-1.6.53/contrib/libtests/timepng.c:454:10: branch_false: following ‘false’ branch...
libpng-1.6.53/contrib/libtests/timepng.c:454:10: branch_false: ...to here
libpng-1.6.53/contrib/libtests/timepng.c:509:7: branch_false: following ‘false’ branch...
libpng-1.6.53/contrib/libtests/timepng.c:512:12: branch_false: ...to here
libpng-1.6.53/contrib/libtests/timepng.c:512:12: branch_true: following ‘true’ branch (when ‘argc > 1’)...
libpng-1.6.53/contrib/libtests/timepng.c:512:12: branch_true: ...to here
libpng-1.6.53/contrib/libtests/timepng.c:516:17: branch_true: following ‘true’ branch (when ‘argc > i’)...
libpng-1.6.53/contrib/libtests/timepng.c:518:13: branch_true: ...to here
libpng-1.6.53/contrib/libtests/timepng.c:518:13: branch_false: following ‘false’ branch (when ‘nfiles != 2147483647’)...
libpng-1.6.53/contrib/libtests/timepng.c:524:40: branch_false: ...to here
libpng-1.6.53/contrib/libtests/timepng.c:524:19: call_function: calling ‘add_one_file’ from ‘main’
#  274|         {
#  275|            /* Fatal error reading the start: */
#  276|->          perror("temporary file");
#  277|            fprintf(stderr, "temporary file fgetpos error\n");
#  278|            exit(1);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def53]
libpng-1.6.53/contrib/libtests/timepng.c:399:16: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(argv[2], "rb")’
libpng-1.6.53/contrib/libtests/timepng.c:370:7: branch_true: following ‘true’ branch (when ‘argc > 2’)...
libpng-1.6.53/contrib/libtests/timepng.c:370:20: branch_true: ...to here
libpng-1.6.53/contrib/libtests/timepng.c:370:8: branch_false: following ‘false’ branch (when the strings are non-equal)...
libpng-1.6.53/contrib/libtests/timepng.c:387:12: branch_false: ...to here
libpng-1.6.53/contrib/libtests/timepng.c:387:12: branch_true: following ‘true’ branch...
libpng-1.6.53/contrib/libtests/timepng.c:389:12: acquire_resource: opened here
libpng-1.6.53/contrib/libtests/timepng.c:391:10: branch_false: following ‘false’ branch...
libpng-1.6.53/contrib/libtests/timepng.c:399:16: branch_false: ...to here
libpng-1.6.53/contrib/libtests/timepng.c:399:16: danger: ‘fopen(argv[2], "rb")’ leaks here; was opened at [(7)](sarif:/runs/0/results/40/codeFlows/0/threadFlows/0/locations/6)
#  397|         }
#  398|   
#  399|->       nfiles = atoi(argv[3]);
#  400|         if (nfiles <= 0)
#  401|         {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def54]
libpng-1.6.53/contrib/libtests/timepng.c:399:16: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(argv[2], "rb")’
libpng-1.6.53/contrib/libtests/timepng.c:370:7: branch_true: following ‘true’ branch (when ‘argc > 2’)...
libpng-1.6.53/contrib/libtests/timepng.c:370:20: branch_true: ...to here
libpng-1.6.53/contrib/libtests/timepng.c:370:8: branch_false: following ‘false’ branch (when the strings are non-equal)...
libpng-1.6.53/contrib/libtests/timepng.c:387:12: branch_false: ...to here
libpng-1.6.53/contrib/libtests/timepng.c:387:12: branch_true: following ‘true’ branch...
libpng-1.6.53/contrib/libtests/timepng.c:389:12: acquire_memory: allocated here
libpng-1.6.53/contrib/libtests/timepng.c:391:10: branch_false: following ‘false’ branch...
libpng-1.6.53/contrib/libtests/timepng.c:399:16: branch_false: ...to here
libpng-1.6.53/contrib/libtests/timepng.c:399:16: danger: ‘fopen(argv[2], "rb")’ leaks here; was allocated at [(7)](sarif:/runs/0/results/41/codeFlows/0/threadFlows/0/locations/6)
#  397|         }
#  398|   
#  399|->       nfiles = atoi(argv[3]);
#  400|         if (nfiles <= 0)
#  401|         {

Error: GCC_ANALYZER_WARNING (CWE-126): [#def55]
libpng-1.6.53/contrib/tools/pngcp.c:718:54: warning[-Wanalyzer-out-of-bounds]: buffer over-read
libpng-1.6.53/contrib/tools/pngcp.c:1997:1: enter_function: entry to ‘write_png’
libpng-1.6.53/contrib/tools/pngcp.c:2002:7: branch_false: following ‘false’ branch...
libpng-1.6.53/contrib/tools/pngcp.c:2008:8: branch_false: ...to here
libpng-1.6.53/contrib/tools/pngcp.c:2014:4: call_function: calling ‘display_start_write’ from ‘write_png’
libpng-1.6.53/contrib/tools/pngcp.c:2014:4: return_function: returning to ‘write_png’ from ‘display_start_write’
libpng-1.6.53/contrib/tools/pngcp.c:2019:7: branch_false: following ‘false’ branch...
libpng-1.6.53/contrib/tools/pngcp.c:2023:29: branch_false: ...to here
libpng-1.6.53/contrib/tools/pngcp.c:2070:7: branch_true: following ‘true’ branch...
libpng-1.6.53/contrib/tools/pngcp.c:2071:7: branch_true: ...to here
libpng-1.6.53/contrib/tools/pngcp.c:2071:7: call_function: calling ‘search_compression’ from ‘write_png’
#  716|   
#  717|      for (j=0; j<option_count; ++j)
#  718|->       if (strncmp(options[j].name, opt, len) == 0 && options[j].name[len] == 0)
#  719|            return j;
#  720|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def56]
libpng-1.6.53/contrib/tools/pngfix.c:1068:10: warning[-Wanalyzer-file-leak]: leak of FILE ‘control.file.file’
libpng-1.6.53/contrib/tools/pngfix.c:3642:1: enter_function: entry to ‘one_file’
libpng-1.6.53/contrib/tools/pngfix.c:3654:9: call_function: inlined call to ‘control_init’ from ‘one_file’
# 1066|            file->write_errno = errno;
# 1067|            file->status_code |= WRITE_ERROR;
# 1068|->          perror(out_name);
# 1069|            return WRITE_ERROR;
# 1070|         }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def57]
libpng-1.6.53/contrib/tools/pngfix.c:1068:10: warning[-Wanalyzer-malloc-leak]: leak of ‘control.file.file’
libpng-1.6.53/contrib/tools/pngfix.c:3642:1: enter_function: entry to ‘one_file’
libpng-1.6.53/contrib/tools/pngfix.c:3654:9: call_function: inlined call to ‘control_init’ from ‘one_file’
# 1066|            file->write_errno = errno;
# 1067|            file->status_code |= WRITE_ERROR;
# 1068|->          perror(out_name);
# 1069|            return WRITE_ERROR;
# 1070|         }

Error: GCC_ANALYZER_WARNING (CWE-775): [#def58]
libpng-1.6.53/contrib/tools/pngfix.c:3576:14: warning[-Wanalyzer-file-leak]: leak of FILE ‘control.file.file’
libpng-1.6.53/contrib/tools/pngfix.c:3642:1: enter_function: entry to ‘one_file’
libpng-1.6.53/contrib/tools/pngfix.c:3654:9: call_function: inlined call to ‘control_init’ from ‘one_file’
libpng-1.6.53/contrib/tools/pngfix.c:3654:9: call_function: inlined call to ‘control_init’ from ‘one_file’
libpng-1.6.53/contrib/tools/pngfix.c:3656:7: branch_true: following ‘true’ branch...
libpng-1.6.53/contrib/tools/pngfix.c:3657:12: branch_true: ...to here
libpng-1.6.53/contrib/tools/pngfix.c:3657:12: call_function: calling ‘read_png’ from ‘one_file’
# 3574|      volatile int rc;
# 3575|   
# 3576|->    png_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING, control,
# 3577|         error_handler, warning_handler);
# 3578|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def59]
libpng-1.6.53/contrib/tools/pngfix.c:3576:14: warning[-Wanalyzer-malloc-leak]: leak of ‘control.file.file’
libpng-1.6.53/contrib/tools/pngfix.c:3642:1: enter_function: entry to ‘one_file’
libpng-1.6.53/contrib/tools/pngfix.c:3654:9: call_function: inlined call to ‘control_init’ from ‘one_file’
libpng-1.6.53/contrib/tools/pngfix.c:3654:9: call_function: inlined call to ‘control_init’ from ‘one_file’
libpng-1.6.53/contrib/tools/pngfix.c:3656:7: branch_true: following ‘true’ branch...
libpng-1.6.53/contrib/tools/pngfix.c:3657:12: branch_true: ...to here
libpng-1.6.53/contrib/tools/pngfix.c:3657:12: call_function: calling ‘read_png’ from ‘one_file’
# 3574|      volatile int rc;
# 3575|   
# 3576|->    png_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING, control,
# 3577|         error_handler, warning_handler);
# 3578|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def60]
libpng-1.6.53/pngwrite.c:2336:25: warning[-Wanalyzer-file-leak]: leak of FILE 'fopen(file_name, "wb")'
libpng-1.6.53/pngwrite.c:2381:1: enter_function: entry to 'png_image_write_to_file'
libpng-1.6.53/pngwrite.c:2386:7: branch_true: following 'true' branch...
libpng-1.6.53/pngwrite.c:2388:10: branch_true: following 'true' branch...
libpng-1.6.53/pngwrite.c:2390:21: branch_true: ...to here
libpng-1.6.53/pngwrite.c:2390:21: acquire_resource: opened here
libpng-1.6.53/pngwrite.c:2392:13: branch_true: following 'true' branch...
libpng-1.6.53/pngwrite.c:2394:17: branch_true: ...to here
libpng-1.6.53/pngwrite.c:2394:17: call_function: calling 'png_image_write_to_stdio' from 'png_image_write_to_file'
# 2334|   {
# 2335|      /* Write the image to the given FILE object. */
# 2336|->    if (image != NULL && image->version == PNG_IMAGE_VERSION)
# 2337|      {
# 2338|         if (file != NULL && buffer != NULL)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def61]
libpng-1.6.53/pngwrite.c:2336:25: warning[-Wanalyzer-malloc-leak]: leak of 'fopen(file_name, "wb")'
libpng-1.6.53/pngwrite.c:2381:1: enter_function: entry to 'png_image_write_to_file'
libpng-1.6.53/pngwrite.c:2386:7: branch_true: following 'true' branch...
libpng-1.6.53/pngwrite.c:2388:10: branch_true: following 'true' branch...
libpng-1.6.53/pngwrite.c:2390:21: branch_true: ...to here
libpng-1.6.53/pngwrite.c:2390:21: acquire_memory: allocated here
libpng-1.6.53/pngwrite.c:2392:13: branch_true: following 'true' branch...
libpng-1.6.53/pngwrite.c:2394:17: branch_true: ...to here
libpng-1.6.53/pngwrite.c:2394:17: call_function: calling 'png_image_write_to_stdio' from 'png_image_write_to_file'
# 2334|   {
# 2335|      /* Write the image to the given FILE object. */
# 2336|->    if (image != NULL && image->version == PNG_IMAGE_VERSION)
# 2337|      {
# 2338|         if (file != NULL && buffer != NULL)

Scan Properties

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