Re: [Code] Help bug

From: Martijn Schoemaker (
Date: 11/29/01

John wrote:

>  if (world[room].func)  /* hope specials do not apply to other rooms */
>   free(world[room].func);

My concern is this piece here. Unless you have modified how special
procedures work in your MUD (i.e. you have dynamically allocated
functions (?)) this will probably disrupt malloc() (and free() with it)
since you are trying to free a piece of code (function) here.

The special procedures are functions and 'func' is only a pointer to
that function or NULL. Since functions cannot be freed, this attempt
is futile and there is no telling what may happen to internal memory

My vote, just forget about func and do NOT free that pointer. To have
a clear concience you might wanna initialize it to NULL, but no
more that that ;)


Try: 4000

------ WARNING: This signature contains a VIRUS ! -------

   | FAQ: |
   | Archives: |

This archive was generated by hypermail 2b30 : 12/06/01 PST