power::eval(): fix several memory leaks
authorAlexei Sheplyakov <alexei.sheplyakov@gmail.com>
Sun, 22 Aug 2010 20:09:18 +0000 (23:09 +0300)
committerJens Vollinga <jensv@nikhef.nl>
Mon, 23 Aug 2010 13:11:58 +0000 (15:11 +0200)
commit5f896fa7f59bbce727e4bba23df9c4bbdbb55c29
tree343885ca49ef037eab3db160836dd5f5ae723d3f
parentbeeb0818e9cdb1b5de0ba2754286ad7bb2a9d032
power::eval(): fix several memory leaks

While working on fsolve bug I've noticed the following in valgrind log:

==17455== 136 (56 direct, 80 indirect) bytes in 1 blocks are definitely lost in loss record 16 of 19
==17455==    at 0x4C249C7: operator new(unsigned long) (vg_replace_malloc.c:220)
==17455==    by 0x516CA70: GiNaC::power::eval(int) const (power.cpp:540)
==17455==    by 0x4FC1E39: GiNaC::ex::construct_from_basic(GiNaC::basic const&) (ex.cpp:310)
==17455==    by 0x406FBF: main (ex.h:255)

Heap allocated objects definitely need the status_flags::dyncallocated flag.
ginac/power.cpp