From: Christophe F. <te...@gn...> - 2006-05-30 13:15:08
|
Le mardi 30 mai 2006 =C3=A0 21:44 +0900, Jorg Schuler a =C3=A9crit : > I'll submit Christophe's patch to make the code nicer -- and take the b= lame: > that was me in gtkpod initially producing the mess... still can't see a= ny > leaks, though :-( if (errordir) { g_set_error (error, 0, -1, _("Problem creating iPod directory or file: '% s'."), errordir); return FALSE; } g_free (errordir); g_free (podpath); =3D> errordir and podpath are leaked if errordir was set for(i =3D 0; i < dirnum; i++) { if (!errordir) { gchar *num =3D g_strdup_printf ("F%02d", i); pbuf =3D g_build_filename (mp, podpath, "Music", num, NULL); if (!g_file_test (pbuf, G_FILE_TEST_EXISTS)) { if((mkdir(pbuf, 0777) !=3D 0)) errordir =3D pbuf; g_free (num); } if (!errordir) g_free (pbuf); } } =3D> g_free (num) should be done unconditionnally Christophe PS: good catch for the hash table issue :) |