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:13:55 +0000 (15:13 +0200)
commitcc94094751459129e1392a93dfa0264adac789a5
treefe0d9fab694ddd014fc12d635b7667fa179933c0
parentd71be995fcb751b52145eb0e50467d15fea541cb
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.
(cherry picked from commit 5f896fa7f59bbce727e4bba23df9c4bbdbb55c29)
ginac/power.cpp