[GRASS-dev] [GRASS GIS] #2063: Memory leak in Rast_read_color_rules() ?

#2063: Memory leak in Rast_read_color_rules() ?
-------------------------+--------------------------------------------------
Reporter: sprice | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 7.0.0
Component: Default | Version: unspecified
Keywords: | Platform: Unspecified
      Cpu: Unspecified |
-------------------------+--------------------------------------------------
I was looking for memory leaks in my program and I think I found one in
Rast_read_color_rules() (if I'm reading it correctly).

http://grass.osgeo.org/programming7/raster_2color__rules_8c_source.html

On line 224 you see G_realloc() called, but no calls to G_free() anywhere.
If I'm reading it correctly, you should insert G_free() at line 254 (or
later).

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/2063&gt;
GRASS GIS <http://grass.osgeo.org>

#2063: Memory leak in Rast_read_color_rules() ?
-------------------------+--------------------------------------------------
Reporter: sprice | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 7.0.0
Component: Default | Version: unspecified
Keywords: | Platform: Unspecified
      Cpu: Unspecified |
-------------------------+--------------------------------------------------

Comment(by glynn):

Replying to [ticket:2063 sprice]:
> I was looking for memory leaks in my program and I think I found one in
Rast_read_color_rules() (if I'm reading it correctly).

Fixed in r57540.

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/2063#comment:1&gt;
GRASS GIS <http://grass.osgeo.org>

#2063: Memory leak in Rast_read_color_rules() ?
-------------------------+--------------------------------------------------
Reporter: sprice | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 7.0.0
Component: Raster | Version: svn-trunk
Keywords: | Platform: Unspecified
      Cpu: Unspecified |
-------------------------+--------------------------------------------------
Changes (by neteler):

  * version: unspecified => svn-trunk
  * component: Default => Raster

Comment:

Diff'ing the updated file with the respective one in G6 it looks like a
backport candidate.
Backport it?

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/2063#comment:2&gt;
GRASS GIS <http://grass.osgeo.org>

#2063: Memory leak in Rast_read_color_rules() ?
--------------------------+-------------------------------------------------
  Reporter: sprice | Owner: grass-dev@…
      Type: defect | Status: closed
  Priority: normal | Milestone: 6.4.4
Component: Raster | Version: svn-trunk
Resolution: fixed | Keywords: libgis
  Platform: Unspecified | Cpu: Unspecified
--------------------------+-------------------------------------------------
Changes (by neteler):

  * keywords: => libgis
  * status: new => closed
  * resolution: => fixed
  * milestone: 7.0.0 => 6.4.4

Comment:

Backported in r59356 and r59357. Closing.

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/2063#comment:3&gt;
GRASS GIS <http://grass.osgeo.org>