#2210 closed defect (fixed)
msFreeHashItems() leaks table->items on empty hash tables
Reported by: | dmorissette | Owned by: | sdlime |
---|---|---|---|
Priority: | normal | Milestone: | 5.0 release |
Component: | MapServer C Library | Version: | unspecified |
Severity: | normal | Keywords: | |
Cc: |
Description
msFreeHashItems() does not attempt to free the table->items memory if numitems == 0. This leads to leaks for empty hash tables initialized with either msCreateHashTable() or initHashTable():
==17790== 164 bytes in 1 blocks are definitely lost in loss record 2 of 6 ==17790== at 0x401C422: malloc (vg_replace_malloc.c:149) ==17790== by 0x80609C0: msCreateHashTable (maphash.c:52) ==17790== by 0x80F192D: msInitWmsParamsObj (mapwmslayer.c:50) ==17790== by 0x808EDFA: msDrawMap (mapdraw.c:307) ==17790== by 0x805856B: msGenerateImages (maptemplate.c:3400) ==17790== by 0x8054EE0: main (mapserv.c:1287) ==17790== ==17790== ==17790== 2,624 bytes in 16 blocks are definitely lost in loss record 3 of 6 ==17790== at 0x401C422: malloc (vg_replace_malloc.c:149) ==17790== by 0x8060A09: initHashTable (maphash.c:65) ==17790== by 0x806BD5B: initMap (mapfile.c:3892) ==17790== by 0x806E6E0: msLoadMap (mapfile.c:4492) ==17790== by 0x805194A: loadMap (mapserv.c:201) ==17790== by 0x80541C7: main (mapserv.c:1160)
Change History (3)
comment:1 by , 17 years ago
comment:2 by , 17 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Yup. Leak is gone. Thanks. Marking fixed.
comment:3 by , 17 years ago
Great. I had a brain fart Sunday morning not noticing the initialization of the items array.
Note:
See TracTickets
for help on using tickets.
Sorry my mistake (and Howard's) I remove that check in r6489. Can you re-run your test?
Steve