Login
User Name:

Password:



Register
Forgot your password?
Vote for Us!
tintin++ ogg sound player script for linux
Author: Robert Smith
Submitted by: Vladaar
6Dragons ogg Soundpack
Author: Vladaar
Submitted by: Vladaar
6Dragons 4.4
Author: Vladaar
Submitted by: Vladaar
LoP 1.46
Author: Remcon
Submitted by: Remcon
LOP 1.45
Author: Remcon
Submitted by: Remcon
Users Online
CommonCrawl, Yandex, Bing

Members: 0
Guests: 11
Stats
Files
Topics
Posts
Members
Newest Member
481
3,734
19,366
618
Micheal64X
Today's Birthdays
Vintar (28)
Related Links
» SmaugMuds.org » Codebases » AFKMud Support & Development » Multiple use of DISPOSE ?
Forum Rules | Mark all | Recent Posts

Multiple use of DISPOSE ?
< Newer Topic :: Older Topic > Just something I noticed

Pages:<< prev 1 next >>
Post is unread #1 Jan 5, 2005, 1:46 am   Last edited May 20, 2005, 8:56 pm by Samson
Go to the top of the page
Go to the bottom of the page

Exodus
Fledgling
GroupMembers
Posts12
JoinedOct 9, 2006

I was just perusing the most recent release of AFKmud and noticed in ban.c it disposes the ban_time field twice. Will that affect anything?

void free_ban( BAN_DATA *pban )
{
    DISPOSE( pban->name );
    DISPOSE( pban->ban_time );
    DISPOSE( pban->note );
    DISPOSE( pban->user );
    DISPOSE( pban->ban_by );
    DISPOSE( pban->ban_time );   <--- Supposed to be here?
    DISPOSE( pban );
}
       
Post is unread #2 Jan 7, 2005, 4:52 am
Go to the top of the page
Go to the bottom of the page

Samson
Black Hand
GroupAdministrators
Posts3,643
JoinedJan 1, 2002

With the more recent releases, no, since the DISPOSE macro checks to see if the pointer exists first before trying to free() it, but in releases where the macro hadn't yet been changed it would be a memory error. In any case it still should not be there and will be corrected.

An error like that in unmodified Smaug code would have generated log messages about freeing NULL pointers.
       
Pages:<< prev 1 next >>