Opened 15 years ago
Closed 14 years ago
#961 closed Defect (fixed)
Memory leak in coproc code
Reported by: | Nicolas | Owned by: | |
---|---|---|---|
Priority: | Minor | Milestone: | Undetermined |
Component: | Undetermined | Version: | 6.10.17 |
Keywords: | cppcheck leak | Cc: | chris@… |
Description
if (strstr(buf, "<coproc_cuda>")) { COPROC_CUDA* cc = new COPROC_CUDA; int retval = cc->parse(fin); if (!retval) { coprocs.push_back(cc); } }
If cc->parse
fails, the COPROC_CUDA
doesn't get added to the coprocs
container, but it's not freed either. In line 198, it goes out of scope, and leaks.
Same a few lines below with COPROC_ATI
(thanks to code duplication).
[found with cppcheck]
Change History (1)
comment:1 Changed 14 years ago by
Cc: | chris@… added |
---|---|
Resolution: | → fixed |
Status: | new → closed |
Note: See
TracTickets for help on using
tickets.
This particular code has been rewritten to avoid the dynamic allocation of COPROC_*