rem: g_free (filename);
context: totem_action_open_files (Totem *totem, char **list, gboolean ignore_first){	int i;	gboolean cleared = FALSE;	i = (ignore_first ? 1 : 0 );	for ( ; list[i] != NULL; i++)	{		char *filename, *subtitle;		filename = g_strdup (list[i]);		subtitle = strrchr (filename, '?');		if (subtitle != NULL)		{			*subtitle = 0;			subtitle++;		}		if (g_file_test (filename, G_FILE_TEST_IS_REGULAR					| G_FILE_TEST_EXISTS)				|| strstr (list[i], "://") != NULL				|| strcmp (list[i], "dvd:") == 0				|| strcmp (list[i], "vcd:") == 0)		{			g_free (filename);			if (cleared == FALSE)			{				/* The function that calls us knows better				 * if we should be doing something with the 				 * changed playlist ... */				g_signal_handlers_disconnect_by_func					(G_OBJECT (totem->playlist),					 playlist_changed_cb, (gpointer) totem);				gtk_playlist_clear (totem->playlist);				cleared = TRUE;			}			if (strcmp (list[i], "dvd:") == 0)			{				totem_action_play_media (totem, MEDIA_DVD);				continue;			} else if (strcmp (list[i], "vcd:") == 0) {				totem_action_play_media (totem, MEDIA_VCD);				continue;			} else if (gtk_playlist_add_mrl (totem->playlist,						list[i], NULL) == TRUE)                        {                                char *uri;                                EggRecentItem *item;				if (list[i][0] != G_DIR_SEPARATOR)					continue;				uri = gnome_vfs_get_uri_from_local_path					(list[i]);				if (uri == NULL) {					/* ok, if this fails, then it was					 * something like dvd:/// and we don't					 * want to add it					 */					continue;				}				item = egg_recent_item_new_from_uri (uri);				egg_recent_item_add_group (item, "Totem");				egg_recent_model_add_full (totem->recent_model,						item);				g_free (uri);			}		}		g_free (filename);	}	/* ... and reconnect because we're nice people */	if (cleared == TRUE)	{		update_buttons (totem);		g_signal_connect (G_OBJECT (totem->playlist),				"changed", G_CALLBACK (playlist_changed_cb),				(gpointer) totem);	}}