Originally posted by [b]opanki[/b]
http://www.eathena.ws/board/index.php?autocom=bugtracker&showbug=4052
Memory manager: Memory leaks found at 2010/02/09 08h08m45s (Revision 14238).
0001 : pc.c line 1666 size 41 address 0x0xb7ed48ac
0002 : pc.c line 1667 size 34 address 0x0xb7ed4aec
0003 : pc.c line 1667 size 34 address 0x0xb7ed516c
0004 : pc.c line 1667 size 34 address 0x0xb7ed53ec
0005 : pc.c line 1666 size 41 address 0x0xb7ed556c
0006 : pc.c line 1666 size 41 address 0x0xb7ed566c
0007 : pc.c line 1666 size 25 address 0x0xb4e53a44
....
CODE
int pc_addautobonus(struct s_autobonus *bonus,char max,const char *script,short rate,unsigned int dur,short flag,const char *other_script,unsigned short pos,bool onskill)
{
int i;
ARR_FIND(0, max, i, bonus[i].rate == 0);
if( i == max )
{
ShowWarning("pc_addautobonus: Reached max (%d) number of autobonus per character!\n", max);
return 0;
}
if( !onskill )
{
if( !(flag&BF_RANGEMASK) )
flag|=BF_SHORT|BF_LONG; //No range defined? Use both.
if( !(flag&BF_WEAPONMASK) )
flag|=BF_WEAPON; //No attack type defined? Use weapon.
if( !(flag&BF_SKILLMASK) )
{
if( flag&(BF_MAGIC|BF_MISC) )
flag|=BF_SKILL; //These two would never trigger without BF_SKILL
if( flag&BF_WEAPON )
flag|=BF_NORMAL|BF_SKILL;
}
}
bonus[i].rate = rate;
bonus[i].duration = dur;
bonus[i].active = INVALID_TIMER;
bonus[i].atk_type = flag;
bonus[i].pos = pos;
bonus[i].bonus_script = aStrdup(script); // <-- 1666 line
bonus[i].other_script = other_script?aStrdup(other_script):NULL; // <-- 1667 line
return 1;
}