[gnome-db]memory leak



Hi,

I'm bit confused about following code. When I check for memory leaks,
memprof finds some. What's wrong? 
BTW the code is from gnome-db/lib/gnome-db-login.

#include <glib.h>
#include <gda-common.h>
#include <liboaf/liboaf.h>

void print_string (gpointer data, gpointer user_data)
{
  /* do something */
  printf ("%s\n", (char*)data);
}

int main (int argc, char **argv) 
{
  GList *list = NULL;

  oaf_init (argc, argv);

  list = gda_list_datasources ();
  g_list_foreach (list, (GFunc)print_string, 0);
  g_list_foreach (list, (GFunc)g_free, 0);
  g_list_free (list);
	        
  return 0;
}

wagi

-- 
Daniel Wagner
email: wagi gmx ch

GnuPG: 1024D/DCDE890A (public key available on any keyserver)




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]