Login
User Name:

Password:



Register
Forgot your password?
Vote for Us!
 Couple bugs
Yesterday, 5:42 pm
By Remcon
Bug in disarm( )
Nov 12, 2017, 6:54 pm
By GatewaySysop
Bug in will_fall( )
Oct 23, 2017, 1:35 am
By GatewaySysop
Bug in do_zap( ), do_brandish( )
Oct 18, 2017, 1:52 pm
By GatewaySysop
Bug in get_exp_worth( )
Oct 10, 2017, 1:26 am
By GatewaySysop
LOP 1.45
Author: Remcon
Submitted by: Remcon
LOP Heroes Edition
Author: Vladaar
Submitted by: Vladaar
Heroes sound extras
Author: Vladaar
Submitted by: Vladaar
6Dragons 4.3
Author: Vladaar
Submitted by: Vladaar
Memwatch
Author: Johan Lindh
Submitted by: Vladaar
Users Online
CommonCrawl, DotBot, Yandex, Google

Members: 0
Guests: 17
Stats
Files
Topics
Posts
Members
Newest Member
477
3,705
19,232
608
LAntorcha
Today's Birthdays
There are no member birthdays today.
Related Links
» SmaugMuds.org » Codebases » SWFOTE FUSS » Just a few issues.
Forum Rules | Mark all | Recent Posts

Just a few issues.
< Newer Topic :: Older Topic >

Pages:<< prev 1 next >>
Post is unread #1 Sep 5, 2010, 9:28 am
Go to the top of the page
Go to the bottom of the page

Remcon
Geomancer
GroupAdministrators
Posts1,858
JoinedJul 26, 2005

swfote14fuss
in fskills.c take a good look at these functions
void fskill_identify( CHAR_DATA * ch, const char *argument )
void fskill_protect( CHAR_DATA * ch, const char *argument )
void fskill_fshield( CHAR_DATA * ch, const char *argument )
void fskill_squeeze( CHAR_DATA * ch, const char *argument )
void fskill_force_lightning( CHAR_DATA * ch, const char *argument )
void fskill_fdisguise( CHAR_DATA * ch, const char *argument )

All of those do this
   if( argument[0] == '\0' )
      argument = str_dup( (const char*)ch->dest_buf );

It never handles freeing up the memory just allocating it there.
I figure someone probably knows a little more about swfotefuss then I do, so I will let someone decide on the best handling of those.

in planets.c look for
            if( !str_cmp( word, "GovernedBy" ) )
            {
               const char *clan_name = fread_string( fp );
               planet->governed_by = get_clan( clan_name );
               fMatch = TRUE;
               STRFREE( clan_name );
            }

change it to
            if( !str_cmp( word, "GovernedBy" ) )
            {
               const char *clan_name = fread_flagstring( fp );
               planet->governed_by = get_clan( clan_name );
               fMatch = TRUE;
            }

look for
            if( !str_cmp( word, "Starsystem" ) )
            {
               const char *starsystem_name = fread_string( fp );
               planet->starsystem = starsystem_from_name( starsystem_name );
               if( planet->starsystem )
               {
                  SPACE_DATA *starsystem = planet->starsystem;

                  LINK( planet, starsystem->first_planet, starsystem->last_planet, next_in_system, prev_in_system );
               }
               fMatch = TRUE;
               STRFREE( starsystem_name );
            }

change it to
            if( !str_cmp( word, "Starsystem" ) )
            {
               const char *starsystem_name = fread_flagstring( fp );
               planet->starsystem = starsystem_from_name( starsystem_name );
               if( planet->starsystem )
               {
                  SPACE_DATA *starsystem = planet->starsystem;

                  LINK( planet, starsystem->first_planet, starsystem->last_planet, next_in_system, prev_in_system );
               }
               fMatch = TRUE;
            }

Since fread_flagstring is in might as well make use of it for those to lol.
       
Post is unread #2 Sep 8, 2010, 4:24 pm
Go to the top of the page
Go to the bottom of the page

Xerix
Fledgling
GroupMembers
Posts15
JoinedDec 2, 2009

Memory Leaks

Thats a previous post from Kayle dealing with almost the exact same thing.
Thought it might be interesting to see why it was put there, since I think
he was the one that put the in FUSS. Not sure.
       
Post is unread #3 Sep 8, 2010, 10:13 pm
Go to the top of the page
Go to the bottom of the page

Kayle
Off the Edge of the Map
GroupAdministrators
Posts1,195
JoinedMar 21, 2006

I didn't think about using fread_flagstring. I just went with the solution Caius provided if I'm not mistaken.
       
Post is unread #4 Sep 10, 2010, 4:23 pm
Go to the top of the page
Go to the bottom of the page

Remcon
Geomancer
GroupAdministrators
Posts1,858
JoinedJul 26, 2005

Ah, those things weren't a leak xerix (well not anymore), the memory leak part was the top part where it puts argument into memory. Those others it is just pointless to use fread_string and then free the temporary pointer when using fread_flagstring instead works great for it.

No worries Kayle I just happened to notice it while looking for other leaks like the top ones I posted.
       
Pages:<< prev 1 next >>