Complete.Org: Mailing Lists: Archives: freeciv-dev: August 2003:
[Freeciv-Dev] (PR#4830) tilespec memory leaks
Home

[Freeciv-Dev] (PR#4830) tilespec memory leaks

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients: ;
Subject: [Freeciv-Dev] (PR#4830) tilespec memory leaks
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Tue, 12 Aug 2003 10:10:45 -0700
Reply-to: rt@xxxxxxxxxxxxxx

The attached patch fixes a few memory leaks in tilespec.c.

jason

Index: client/tilespec.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/tilespec.c,v
retrieving revision 1.128
diff -u -r1.128 tilespec.c
--- client/tilespec.c   2003/08/11 01:54:14     1.128
+++ client/tilespec.c   2003/08/12 17:10:08
@@ -280,7 +280,6 @@
     free(minimap_intro_filename);
     minimap_intro_filename = NULL;
   }
-  /* FIXME: free spec_filenames */
 }
 
 /**********************************************************************
@@ -665,6 +664,7 @@
 
     specfile_list_insert(&specfiles, sf);
   }
+  free(spec_filenames);
 
   section_file_check_unused(file, fname);
   
@@ -2486,12 +2486,17 @@
     } small_sprite_list_iterate_end;
 
     specfile_list_unlink(&specfiles, sf);
+    free(sf->file_name);
     if (sf->big_sprite) {
       free_sprite(sf->big_sprite);
       sf->big_sprite = NULL;
     }
     free(sf);
   } specfile_list_iterate_end;
+
+  if (num_tiles_explode_unit > 0) {
+    free(sprites.explode.unit);
+  }
 }
 
 /**************************************************************************

[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] (PR#4830) tilespec memory leaks, Jason Short <=