[sushi/gnome-3-4] cover-art: plug some leaks



commit 2c27f9847c9524eb69c02ea31be780219b98947f
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Wed Apr 11 13:12:56 2012 -0400

    cover-art: plug some leaks
    
    The variables coming from libmusicbrainz should be freed.

 src/libsushi/sushi-cover-art.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/src/libsushi/sushi-cover-art.c b/src/libsushi/sushi-cover-art.c
index 0ab4259..73e5696 100644
--- a/src/libsushi/sushi-cover-art.c
+++ b/src/libsushi/sushi-cover-art.c
@@ -226,6 +226,8 @@ fetch_uri_job (GIOSchedulerJob *sched_job,
   filter = mb_release_filter_artist_name (filter, job->artist);
 
   results = mb_query_get_releases (query, filter);
+  mb_query_free (query);
+  mb_release_filter_free (filter);
 
   if (results)
     results_len = mb_result_list_get_size (results);
@@ -236,6 +238,8 @@ fetch_uri_job (GIOSchedulerJob *sched_job,
     release = mb_result_list_get_release (results, idx);
     mb_release_get_asin (release, asin, 255);
 
+    mb_release_free (release);
+
     if (asin != NULL &&
         asin[0] != '\0') {
       retval = g_strdup (asin);
@@ -243,6 +247,9 @@ fetch_uri_job (GIOSchedulerJob *sched_job,
     }
   }
 
+  if (results)
+    mb_result_list_free (results);
+
   if (retval == NULL) {
     /* FIXME: do we need a better error? */
     g_simple_async_result_set_error (job->result,



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