Opened 11 years ago
Closed 11 years ago
#2643 closed defect (worksforme)
[raster] memory leaks
Reported by: | yngwar | Owned by: | Bborie Park |
---|---|---|---|
Priority: | medium | Milestone: | PostGIS 2.1.2 |
Component: | raster | Version: | 2.1.x |
Keywords: | Cc: |
Description
Every time when "rt_raster_deserialize(...)" is used in some functions (for example in "RASTER_out") - on exit you destroy memory allocated structures by call "rt_raster_destroy(...)". This function calls "rtdealloc(raster->bands)" to free array of pointers to "rt_band_t". Then it calls "rtdealloc(raster)" to free "rt_raster_t". But you never free the memory allocated by structure "rt_band_t" for each band in band pointer array "raster->bands". Why? I think it couses the memory leaks.
Change History (2)
comment:1 by , 11 years ago
comment:2 by , 11 years ago
Resolution: | → worksforme |
---|---|
Status: | new → closed |
I'm going to close this out - sounds like you aren't seeing anything wrong.
Note:
See TracTickets
for help on using tickets.
PostgreSQL memory contexts automatically clean up those "dangling" memory allocations when the context itself is freed (I noticed you mentioned RASTER_out). For code running outside of PostgreSQL (such as raster2pgsql and the CUnit unit tests), we explicitly free those memory allocations.
All raster code gets repeatedly tested with valgrind to find these memory issues and I can't find any at the present time.