Opened 9 years ago

Closed 8 years ago

#6176 closed defect (fixed)

ogrlineref leaks memory

Reported by: Even Rouault Owned by: bishop
Priority: normal Milestone: 2.1.0
Component: Utilities Version: unspecified
Severity: normal Keywords:
Cc:

Description

test_ogrlineref.py reveals leaks in ogrlineref.

See https://s3.amazonaws.com/archive.travis-ci.org/jobs/87731603/log.txt

Also confirmed by valgrind:

$ valgrind --leak-check=full ogrlineref -create -l data/path.shp -p data/mstones.shp -pm pos -o tmp/parts.shp -s 1000

==29803== 48 bytes in 1 blocks are definitely lost in loss record 757 of 1,655
==29803==    at 0x4C2998A: operator new(unsigned long) (vg_replace_malloc.c:298)
==29803==    by 0x40C70B: CreatePartsFromLineString(OGRLineString*, OGRLayer*, int, double, OGRLayer*, int, int, char const*, char const*) (ogrlineref.cpp:702)
==29803==    by 0x40DBE4: CreateParts(OGRLayer*, OGRLayer*, int, double, OGRLayer*, int, int, char const*, char const*) (ogrlineref.cpp:975)
==29803==    by 0x410017: main (ogrlineref.cpp:1520)
==29803== 
==29803== 48 bytes in 1 blocks are definitely lost in loss record 758 of 1,655
==29803==    at 0x4C2998A: operator new(unsigned long) (vg_replace_malloc.c:298)
==29803==    by 0x40D06F: CreatePartsFromLineString(OGRLineString*, OGRLayer*, int, double, OGRLayer*, int, int, char const*, char const*) (ogrlineref.cpp:811)
==29803==    by 0x40DBE4: CreateParts(OGRLayer*, OGRLayer*, int, double, OGRLayer*, int, int, char const*, char const*) (ogrlineref.cpp:975)
==29803==    by 0x410017: main (ogrlineref.cpp:1520)
==29803== 
==29803== 72 (40 direct, 32 indirect) bytes in 1 blocks are definitely lost in loss record 791 of 1,655
==29803==    at 0x4C2998A: operator new(unsigned long) (vg_replace_malloc.c:298)
==29803==    by 0x609852B: OGRSimpleCurve::getSubLine(double, double, int) const (ogrlinestring.cpp:1353)
==29803==    by 0x40CBE8: CreatePartsFromLineString(OGRLineString*, OGRLayer*, int, double, OGRLayer*, int, int, char const*, char const*) (ogrlineref.cpp:762)
==29803==    by 0x40DBE4: CreateParts(OGRLayer*, OGRLayer*, int, double, OGRLayer*, int, int, char const*, char const*) (ogrlineref.cpp:975)
==29803==    by 0x410017: main (ogrlineref.cpp:1520)
==29803== 
==29803== 72 (40 direct, 32 indirect) bytes in 1 blocks are definitely lost in loss record 792 of 1,655
==29803==    at 0x4C2998A: operator new(unsigned long) (vg_replace_malloc.c:298)
==29803==    by 0x609852B: OGRSimpleCurve::getSubLine(double, double, int) const (ogrlinestring.cpp:1353)
==29803==    by 0x40CDE4: CreatePartsFromLineString(OGRLineString*, OGRLayer*, int, double, OGRLayer*, int, int, char const*, char const*) (ogrlineref.cpp:779)
==29803==    by 0x40DBE4: CreateParts(OGRLayer*, OGRLayer*, int, double, OGRLayer*, int, int, char const*, char const*) (ogrlineref.cpp:975)
==29803==    by 0x410017: main (ogrlineref.cpp:1520)
==29803== 
==29803== 168 (40 direct, 128 indirect) bytes in 1 blocks are definitely lost in loss record 1,301 of 1,655
==29803==    at 0x4C2998A: operator new(unsigned long) (vg_replace_malloc.c:298)
==29803==    by 0x609852B: OGRSimpleCurve::getSubLine(double, double, int) const (ogrlinestring.cpp:1353)
==29803==    by 0x40C480: CreatePartsFromLineString(OGRLineString*, OGRLayer*, int, double, OGRLayer*, int, int, char const*, char const*) (ogrlineref.cpp:670)
==29803==    by 0x40DBE4: CreateParts(OGRLayer*, OGRLayer*, int, double, OGRLayer*, int, int, char const*, char const*) (ogrlineref.cpp:975)
==29803==    by 0x410017: main (ogrlineref.cpp:1520)
==29803== 
==29803== 184 (40 direct, 144 indirect) bytes in 1 blocks are definitely lost in loss record 1,302 of 1,655
==29803==    at 0x4C2998A: operator new(unsigned long) (vg_replace_malloc.c:298)
==29803==    by 0x609852B: OGRSimpleCurve::getSubLine(double, double, int) const (ogrlinestring.cpp:1353)
==29803==    by 0x40C940: CreatePartsFromLineString(OGRLineString*, OGRLayer*, int, double, OGRLayer*, int, int, char const*, char const*) (ogrlineref.cpp:723)
==29803==    by 0x40DBE4: CreateParts(OGRLayer*, OGRLayer*, int, double, OGRLayer*, int, int, char const*, char const*) (ogrlineref.cpp:975)
==29803==    by 0x410017: main (ogrlineref.cpp:1520)
==29803== 
==29803== 384 bytes in 8 blocks are definitely lost in loss record 1,629 of 1,655
==29803==    at 0x4C2998A: operator new(unsigned long) (vg_replace_malloc.c:298)
==29803==    by 0x40D4E2: CreatePartsFromLineString(OGRLineString*, OGRLayer*, int, double, OGRLayer*, int, int, char const*, char const*) (ogrlineref.cpp:869)
==29803==    by 0x40DBE4: CreateParts(OGRLayer*, OGRLayer*, int, double, OGRLayer*, int, int, char const*, char const*) (ogrlineref.cpp:975)
==29803==    by 0x410017: main (ogrlineref.cpp:1520)
==29803== 
==29803== 989 (40 direct, 949 indirect) bytes in 1 blocks are definitely lost in loss record 1,645 of 1,655
==29803==    at 0x4C2998A: operator new(unsigned long) (vg_replace_malloc.c:298)
==29803==    by 0x6089204: OGRGeometryFactory::createGeometry(OGRwkbGeometryType) (ogrgeometryfactory.cpp:421)
==29803==    by 0x6095E56: OGRSimpleCurve::clone() const (ogrlinestring.cpp:125)
==29803==    by 0x40DBAB: CreateParts(OGRLayer*, OGRLayer*, int, double, OGRLayer*, int, int, char const*, char const*) (ogrlineref.cpp:975)
==29803==    by 0x410017: main (ogrlineref.cpp:1520)
==29803== 
==29803== 1,061 (336 direct, 725 indirect) bytes in 7 blocks are definitely lost in loss record 1,648 of 1,655
==29803==    at 0x4C2998A: operator new(unsigned long) (vg_replace_malloc.c:298)
==29803==    by 0x6093EDC: OGRPoint::clone() const (ogrpoint.cpp:152)
==29803==    by 0x40C034: CreatePartsFromLineString(OGRLineString*, OGRLayer*, int, double, OGRLayer*, int, int, char const*, char const*) (ogrlineref.cpp:587)
==29803==    by 0x40DBE4: CreateParts(OGRLayer*, OGRLayer*, int, double, OGRLayer*, int, int, char const*, char const*) (ogrlineref.cpp:975)
==29803==    by 0x410017: main (ogrlineref.cpp:1520)

Change History (1)

comment:1 by Even Rouault, 8 years ago

Milestone: 2.1.0
Resolution: fixed
Status: newclosed

trunk r32724 "ogrlineref: fix memory leaks (#6176)"

Note: See TracTickets for help on using tickets.