Commit 669acd98 authored by W. Michael Petullo's avatar W. Michael Petullo
Browse files

Get rid of some memory leaks identified by valgrind


Signed-off-by: W. Michael Petullo's avatarW. Michael Petullo <mike@flyn.org>
parent e0ebbf56
......@@ -587,10 +587,12 @@ add_entry_to_mlcl (gpointer id,
gchar *transcode_mimetype = NULL;
/* FIXME: This should be share, not record: */
g_object_get (record, "transcode-mimetype", &transcode_mimetype, NULL);
if (transcode_mimetype)
if (transcode_mimetype) {
format = g_strdup (mime_to_format (transcode_mimetype));
else
g_free (transcode_mimetype);
} else {
g_object_get (record, "format", &format, NULL);
}
if (format) {
dmap_structure_add (mlit, DMAP_CC_ASFM, format);
g_free (format);
......@@ -651,18 +653,22 @@ add_entry_to_mlcl (gpointer id,
if (_dmap_share_client_requested (mb->bits, SONG_SORT_ARTIST)) {
gchar *sort_artist = NULL;
g_object_get (record, "sort-artist", &sort_artist, NULL);
if (sort_artist)
if (sort_artist) {
dmap_structure_add (mlit, DMAP_CC_ASSA, sort_artist);
else
g_free (sort_artist);
} else {
g_warning ("Sort artist requested but not available");
}
}
if (_dmap_share_client_requested (mb->bits, SONG_SORT_ALBUM)) {
gchar *sort_album = NULL;
g_object_get (record, "sort-album", &sort_album, NULL);
if (sort_album)
if (sort_album) {
dmap_structure_add (mlit, DMAP_CC_ASSU, sort_album);
else
g_free (sort_album);
} else {
g_warning ("Sort album requested but not available");
}
}
if (_dmap_share_client_requested (mb->bits, SONG_MEDIAKIND)) {
gint mediakind = 0;
......
......@@ -932,7 +932,7 @@ handle_song_listing (DMAPConnection *connection,
g_object_get (record, "format", &format, NULL);
if (format == NULL) {
format = "Unknown";
format = g_strdup ("Unknown");
}
/*if (connection->dmap_version == 3.0) {*/
......@@ -957,6 +957,7 @@ handle_song_listing (DMAPConnection *connection,
g_object_unref (record);
g_hash_table_insert (connection->priv->item_id_to_uri, GINT_TO_POINTER (item_id), g_strdup (uri));
g_free (uri);
g_free (format);
} else {
g_debug ("cannot create record for daap track");
}
......
......@@ -516,7 +516,7 @@ browse_cb (AvahiServiceBrowser *service_browser,
local = ((flags & AVAHI_LOOKUP_RESULT_LOCAL) != 0);
#endif
if (local && getenv ("LIBDMAPSHARING_ENABLE_LOCAL") == NULL) {
g_debug ("Ignoring local service %s", name);
g_warning ("Ignoring local service %s", name);
return;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment