# HG changeset patch # User John Lindgren # Date 1240709574 14400 # Node ID 56af01cd5a5ce5c7f2f6deeaef7a8d6f838a25d0 # Parent f07844bdc43f513c943e90e19e3422760f9bbe3d Eliminate a double free (bug #30) diff -r f07844bdc43f -r 56af01cd5a5c src/audlegacy/dbus.c --- a/src/audlegacy/dbus.c Fri Apr 24 09:43:41 2009 +0100 +++ b/src/audlegacy/dbus.c Sat Apr 25 21:32:54 2009 -0400 @@ -89,10 +89,10 @@ guint request_ret; g_message("Registering remote D-Bus interfaces"); - + dbus_g_object_type_install_info(audacious_rc_get_type(), &dbus_glib_audacious_rc_object_info); - + // Register DBUS path dbus_g_connection_register_g_object(dbus_conn, AUDACIOUS_DBUS_PATH, G_OBJECT(object)); @@ -121,7 +121,7 @@ void mpris_root_init(MprisRoot *object) { dbus_g_object_type_install_info(mpris_root_get_type(), &dbus_glib_mpris_root_object_info); - + // Register DBUS path dbus_g_connection_register_g_object(dbus_conn, AUDACIOUS_DBUS_PATH_MPRIS_ROOT, @@ -131,7 +131,7 @@ void mpris_player_init(MprisPlayer *object) { dbus_g_object_type_install_info(mpris_player_get_type(), &dbus_glib_mpris_player_object_info); - + // Register DBUS path dbus_g_connection_register_g_object(dbus_conn, AUDACIOUS_DBUS_PATH_MPRIS_PLAYER, @@ -155,7 +155,7 @@ void mpris_tracklist_init(MprisTrackList *object) { dbus_g_object_type_install_info(mpris_tracklist_get_type(), &dbus_glib_mpris_tracklist_object_info); - + // Register DBUS path dbus_g_connection_register_g_object(dbus_conn, AUDACIOUS_DBUS_PATH_MPRIS_TRACKLIST, @@ -244,7 +244,7 @@ value = tuple_value_to_gvalue(tuple, "track-number"); if (value != NULL) { - g_hash_table_insert(md, "tracknumber", value); + g_hash_table_insert(md, "tracknumber", value); } return md; @@ -562,7 +562,7 @@ res[i] = g_strdup(tuple_fields[i].name); } *fields = res; - + return TRUE; } @@ -912,10 +912,7 @@ gchar *pl_name = NULL; pl_name = (gchar*)playlist_get_current_name(new_pl); - if(!pl_name) - pl_name = g_strdup("New Playlist"); - playlist_set_current_name(new_pl, pl_name); - g_free(pl_name); + playlist_set_current_name (new_pl, pl_name ? pl_name : "New Playlist"); playlist_add_playlist(new_pl); @@ -928,7 +925,7 @@ return TRUE; } -/* New on Nov 7: Equalizer */ +/* New on Nov 7: Equalizer */ gboolean audacious_rc_get_eq(RemoteObject *obj, gdouble *preamp, GArray **bands, GError **error) { int i; @@ -960,7 +957,7 @@ { gdouble element; int i; - + equalizer_set_preamp((gfloat)preamp); for (i = 0; i < AUD_EQUALIZER_NBANDS; i++) {