Fixed a memleak I recently added
authorskeezix <skeezix@flotsam-vm.(none)>
Sun, 11 Oct 2009 12:45:31 +0000 (08:45 -0400)
committerskeezix <skeezix@flotsam-vm.(none)>
Sun, 11 Oct 2009 12:45:31 +0000 (08:45 -0400)
lib/pnd_desktop.c

index 3bb3066..c2cffec 100644 (file)
@@ -381,10 +381,15 @@ int pnd_map_dotdesktop_categories ( pnd_conf_handle c, char *target_buffer, unsi
 // given category 'foo', look it up in the provided config map. return the char* reference, or NULL
 char *pnd_map_dotdesktop_category ( pnd_conf_handle c, char *single_category ) {
   char *key;
+  char *ret;
 
   key = malloc ( strlen ( single_category ) + 4 + 1 );
 
   sprintf ( key, "map.%s", single_category );
 
-  return ( pnd_conf_get_as_char ( c, key ) );
+  ret = pnd_conf_get_as_char ( c, key );
+
+  free ( key );
+
+  return ( ret );
 }