Memoryleak in ScanDraiD::processSingleFrame()
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
ScanDraiD |
Fix Released
|
High
|
quirxi |
Bug Description
The code is in line 106:
101 float* ScanDraiD:
102 {
103 scanDraiD::Jpeg* jpg = new scanDraiD::Jpeg;
104 jpg->load(
105 numberPoints_ = jpg->getHeight() / lineSkip_;
106 float* res = new float[3 * numberPoints_];
107 float frame_angle = ((float) frameNr) * (360.0f / (float) numberFrames_);
It would probably be better to use std::vector instead of an array of floats!
Here is the output of valgrind:
> valgrind --leak-check=full ./ScanDraiD.exe -i=../.
==22613== Memcheck, a memory error detector.
==22613== Copyright (C) 2002-2008, and GNU GPL'd, by Julian Seward et al.
==22613== Using LibVEX rev 1878, a library for dynamic binary translation.
==22613== Copyright (C) 2004-2008, and GNU GPL'd, by OpenWorks LLP.
==22613== Using valgrind-3.4.0, a dynamic binary instrumentation framework.
==22613== Copyright (C) 2000-2008, and GNU GPL'd, by Julian Seward et al.
==22613== For more details, rerun with: -v
==22613==
==22613== frame 360/360: '../../
==22613== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 7 from 1)
==22613== malloc/free: in use at exit: 1,728,000 bytes in 360 blocks.
==22613== malloc/free: 6,902 allocs, 6,542 frees, 191,107,889 bytes allocated.
==22613== For counts of detected errors, rerun with: -v
==22613== searching for pointers to 360 not-freed blocks.
==22613== checked 94,680 bytes.
==22613==
==22613== 1,728,000 bytes in 360 blocks are definitely lost in loss record 1 of 1
==22613== at 0x40237AF: operator new[](unsigned int) (in /usr/lib/
==22613== by 0x804BCB0: scanDraiD:
==22613== by 0x804D82C: scanDraiD:
==22613== by 0x80505F7: main (main.cpp:217)
==22613==
==22613== LEAK SUMMARY:
==22613== definitely lost: 1,728,000 bytes in 360 blocks.
==22613== possibly lost: 0 bytes in 0 blocks.
==22613== still reachable: 0 bytes in 0 blocks.
==22613== suppressed: 0 bytes in 0 blocks.
Related branches
Changed in scandraid: | |
assignee: | nobody → a-w |
importance: | Undecided → High |
milestone: | none → 01.alpha |
Changed in scandraid: | |
status: | New → Fix Released |