[CODE] Do I need to Free this?

From: Justin Adler (spam@WORLD-DOMINATION.COM.AU)
Date: 02/05/02


Hello All.

  I have this piece of code, and i'm wondering if i need to free this.

Here is my current working code.

I know u have to free anything that is CREATE'd, which these structures
are ... but i'm not sure how.

thank you kindly.

-PK-

-----------------------


void rent_update (void)
{
  struct descriptor_data *i = NULL;
  struct char_data *ch = NULL;
  struct rent_list *rent = NULL, *temp = NULL;


  for (i = descriptor_list; i; i = i->next)
    if (!i->connected && i->character) {
      ch = i->character;

      if (!ch)
        return;

      if (IS_NPC(ch))
        return;

      while ( (rent = GET_RENT(ch)) != NULL) {
        if (rent->hours < 1) {
          REMOVE_FROM_LIST(rent, GET_RENT(ch), next);
          free(rent);
        } else
          rent->hours--;

        rent = rent->next;
      }
}

--
   +---------------------------------------------------------------+
   | FAQ: http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html |
   | Archives: http://post.queensu.ca/listserv/wwwarch/circle.html |
   | Newbie List:  http://groups.yahoo.com/group/circle-newbies/   |
   +---------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 06/25/03 PDT