Opened 14 years ago

Last modified 9 years ago

#1323 new defect

DebCheck QA: Resource leaks

Reported by: hamish Owned by: grass-dev@…
Priority: normal Milestone: 6.4.6
Component: Compiling Version: 6.4.0
Keywords: gem, i.ortho.photo, i.points, i.vpoints, lib/cairodriver, lib/gis/copy_file.c, lib/gis/error.c, lib/gis/ls.c, r.li, r.mfilter, r.mfilter.fp, r.out.gridatb, r.statistics, r.terraflow, r3.in.v5d, r3.out.v5d, r3.showdspf Cc:
CPU: Unspecified Platform: Linux

Description

Hi,

Debian's run of the Cpp check tool automatically found a number of C-code errors (or potential errors) which need to be reviewed by hand. See grass-dev ML thread of 13 Jan 2011.

about: Cppcheck is a command-line tool that tries to detect bugs that your C/C++ compiler doesn't see. It is versatile, and can check non-standard code including various compiler extensions, inline assembly code, etc. Its internal preprocessor can handle includes, macros, and several preprocessor commands. While Cppcheck is highly configurable, you can start using it just by giving it a path to the source code.

http://www.linuxjournal.com/content/daca-could-mean-less-bugs-debian

the list of probably-bugs in the 6.4.0 C/C++ code:

http://qa.debian.org/daca/cppcheck/squeeze/grass_6.4.0~rc6+42329-3.html

CLI analysis program (not Debian specific):

http://cppcheck.wiki.sourceforge.net

I have split those 154 hits into 16 classes, and will report each class in an individual bug report.

Run against releasebranch6_4 r42329 (including all patches up to, but not beyond, 6.4.0-final)


This bug report is for: Resource leaks

  • ./display/d.profile/Range.c:48 [error] - Resource leak: temp_file
  • ./gem/at_exit_funcs.c:103 [error] - Resource leak: dir
  • ./gem/reg_entries.c:316 [error] - Resource leak: f_out
  • ./gem/reg_entries.c:525 [error] - Resource leak: f_out
  • ./gem/reg_entries.c:756 [error] - Resource leak: f_out
  • ./gem/reg_html.c:228 [error] - Resource leak: f_out
  • ./gem/reg_html.c:330 [error] - Resource leak: f_out
  • ./gem/reg_html.c:440 [error] - Resource leak: f_out
  • ./gem/tools.c:683 [error] - Resource leak: dir
  • ./gem/tools.c:719 [error] - Resource leak: dir
  • ./gem/tools.c:823 [error] - Resource leak: f
  • ./imagery/i.ortho.photo/photo.2image/ask.c:265 [error] - Resource leak: fd
  • ./imagery/i.ortho.photo/photo.2target/ask.c:263 [error] - Resource leak: fd
  • ./imagery/i.points/ask.c:264 [error] - Resource leak: fd
  • ./imagery/i.vpoints/ask.c:260 [error] - Resource leak: fd
  • ./lib/cairodriver/read_ppm.c:26 [error] - Resource leak: input
  • ./lib/gis/copy_file.c:48 [error] - Resource leak: infp
  • ./lib/gis/error.c:346 [error] - Resource leak: log
  • ./lib/gis/ls.c:114 [error] - Resource leak: dfd
  • ./raster/r.li/r.li.cwed/cwed.c:127 [error] - Resource leak: file_fd
  • ./raster/r.li/r.li.cwed/cwed.c:333 [error] - Resource leak: mask_fd
  • ./raster/r.li/r.li.cwed/cwed.c:476 [error] - Resource leak: mask_fd
  • ./raster/r.li/r.li.cwed/cwed.c:612 [error] - Resource leak: mask_fd
  • ./raster/r.li/r.li.daemon/daemon.c:282 [error] - Resource leak: res
  • ./raster/r.li/r.li.daemon/daemon.c:282 [error] - Resource leak: random_access
  • ./raster/r.li/r.li.daemon/worker.c:259 [error] - Resource leak: mask_fd
  • ./raster/r.li/r.li.dominance/dominance.c:159 [error] - Resource leak: mask_fd
  • ./raster/r.li/r.li.dominance/dominance.c:370 [error] - Resource leak: mask_fd
  • ./raster/r.li/r.li.dominance/dominance.c:574 [error] - Resource leak: mask_fd
  • ./raster/r.li/r.li.edgedensity/edgedensity.c:164 [error] - Resource leak: mask_fd
  • ./raster/r.li/r.li.edgedensity/edgedensity.c:427 [error] - Resource leak: mask_fd
  • ./raster/r.li/r.li.edgedensity/edgedensity.c:692 [error] - Resource leak: mask_fd
  • ./raster/r.li/r.li.mpa/mpa.c:137 [error] - Resource leak: mask_fd
  • ./raster/r.li/r.li.mpa/mpa.c:200 [error] - Resource leak: mask_fd
  • ./raster/r.li/r.li.mpa/mpa.c:265 [error] - Resource leak: mask_fd
  • ./raster/r.li/r.li.mps/mps.c:159 [error] - Resource leak: mask_fd
  • ./raster/r.li/r.li.mps/mps.c:530 [error] - Resource leak: mask_fd
  • ./raster/r.li/r.li.mps/mps.c:900 [error] - Resource leak: mask_fd
  • ./raster/r.li/r.li.padcv/padcv.c:138 [error] - Resource leak: mask_fd
  • ./raster/r.li/r.li.padcv/padcv.c:535 [error] - Resource leak: mask_fd
  • ./raster/r.li/r.li.padcv/padcv.c:928 [error] - Resource leak: mask_fd
  • ./raster/r.li/r.li.padrange/padrange.c:146 [error] - Resource leak: mask_fd
  • ./raster/r.li/r.li.padrange/padrange.c:547 [error] - Resource leak: mask_fd
  • ./raster/r.li/r.li.padrange/padrange.c:930 [error] - Resource leak: mask_fd
  • ./raster/r.li/r.li.padsd/padsd.c:137 [error] - Resource leak: mask_fd
  • ./raster/r.li/r.li.padsd/padsd.c:536 [error] - Resource leak: mask_fd
  • ./raster/r.li/r.li.padsd/padsd.c:927 [error] - Resource leak: mask_fd
  • ./raster/r.li/r.li.patchdensity/main.c:204 [error] - Resource leak: mask_fd
  • ./raster/r.li/r.li.patchnum/main.c:180 [error] - Resource leak: mask_fd
  • ./raster/r.li/r.li.richness/richness.c:145 [error] - Resource leak: mask_fd
  • ./raster/r.li/r.li.richness/richness.c:303 [error] - Resource leak: mask_fd
  • ./raster/r.li/r.li.richness/richness.c:465 [error] - Resource leak: mask_fd
  • ./raster/r.li/r.li.shannon/shannon.c:155 [error] - Resource leak: mask_fd
  • ./raster/r.li/r.li.shannon/shannon.c:362 [error] - Resource leak: mask_fd
  • ./raster/r.li/r.li.shannon/shannon.c:565 [error] - Resource leak: mask_fd
  • ./raster/r.li/r.li.shape/main.c:85 [error] - Resource leak: mask_fd
  • ./raster/r.li/r.li.simpson/simpson.c:154 [error] - Resource leak: mask_fd
  • ./raster/r.li/r.li.simpson/simpson.c:343 [error] - Resource leak: mask_fd
  • ./raster/r.li/r.li.simpson/simpson.c:532 [error] - Resource leak: mask_fd
  • ./raster/r.mfilter.fp/getfilt.c:162 [error] - Resource leak: fd
  • ./raster/r.mfilter/getfilt.c:160 [error] - Resource leak: fd
  • ./raster/r.out.gridatb/file_io.c:105 [error] - Resource leak: fp
  • ./raster/r.statistics/o_distrib.c:70 [error] - Resource leak: fd1
  • ./raster/r.terraflow/stats.cc:80 [error] - Resource leak: fd
  • ./raster3d/r3.in.v5d/v5d.c:2001 [error] - Resource leak: fd
  • ./raster3d/r3.in.v5d/v5d.c:2381 [error] - Resource leak: fd
  • ./raster3d/r3.out.v5d/v5d.c:2001 [error] - Resource leak: fd
  • ./raster3d/r3.out.v5d/v5d.c:2381 [error] - Resource leak: fd
  • ./raster3d/r3.showdspf/new_init_graphics.c:234 [error] - Resource leak: fp

Modules: gem, i.ortho.photo, i.points, i.vpoints, lib/cairodriver, lib/gis/copy_file.c, lib/gis/error.c, lib/gis/ls.c, r.li, r.mfilter, r.mfilter.fp, r.out.gridatb, r.statistics, r.terraflow, r3.in.v5d, r3.out.v5d, r3.showdspf

thanks, Hamish

Change History (4)

comment:1 by hamish, 12 years ago

Milestone: 6.4.26.4.4

d.profile done in devbr6 with r55840.

comment:2 by hamish, 10 years ago

Milestone: 6.4.46.4.5

comment:3 by martinl, 9 years ago

Milestone: 6.4.5

Ticket retargeted after milestone closed

comment:4 by martinl, 9 years ago

Milestone: 6.4.6
Note: See TracTickets for help on using tickets.