Opened 15 years ago

Closed 15 years ago

#659 closed defect (fixed)

probable memory leak in v.surf.bspline

Reported by: hamish Owned by: grass-dev@…
Priority: normal Milestone: 6.4.0
Component: Vector Version: 6.4.0 RCs
Keywords: v.surf.bspline Cc:
CPU: All Platform: All

Description

Hi,

source:grass/trunk/vector/lidar/v.surf.bspline/main.c@#L364 has:

nrows = G_window_rows();
ncols = G_window_cols();

if (!G_alloc_matrix(nrows, ncols))
    G_fatal_error(_("Interpolation: The region resolution is too high: "
		   "%d cells. Consider to change it."), nrows * ncols);

is that a rather big memory leak? should it be like:

raster_matrix = G_alloc_matrix(nrows, ncols);

if (!raster_matrix)
    G_fatal_error(...);
else
    G_free_matrix(raster_matrix);

?

Hamish

Change History (1)

comment:1 by mmetz, 15 years ago

Resolution: fixed
Status: newclosed

Right, raster_matrix was allocated twice for some obscure reason. Fixed in all branches with the recent overhaul of the lidar tools.

Note: See TracTickets for help on using tickets.