[PATCH] upnp: don't leak struct OperationSpec even on error



---
 src/upnp/grl-upnp.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/src/upnp/grl-upnp.c b/src/upnp/grl-upnp.c
index 0789fee..9e7c9aa 100644
--- a/src/upnp/grl-upnp.c
+++ b/src/upnp/grl-upnp.c
@@ -1110,6 +1110,7 @@ grl_upnp_source_browse (GrlMediaSource *source, GrlMediaSourceBrowseSpec *bs)
 			 "Failed to start browse action");
     bs->callback (bs->source, bs->browse_id, NULL, 0, bs->user_data, error);
     g_error_free (error);
+    g_slice_free (struct OperationSpec, os);
   }
 
   g_free (upnp_filter);
@@ -1164,6 +1165,7 @@ grl_upnp_source_search (GrlMediaSource *source, GrlMediaSourceSearchSpec *ss)
 			 "Failed to start browse action");
     ss->callback (ss->source, ss->search_id, NULL, 0, ss->user_data, error);
     g_error_free (error);
+    g_slice_free (struct OperationSpec, os);
   }
 
   g_free (upnp_filter);
@@ -1226,6 +1228,7 @@ grl_upnp_source_query (GrlMediaSource *source, GrlMediaSourceQuerySpec *qs)
 			 "Failed to start query action");
     qs->callback (qs->source, qs->query_id, NULL, 0, qs->user_data, error);
     g_error_free (error);
+    g_slice_free (struct OperationSpec, os);
   }
 
   g_free (upnp_filter);
-- 
1.7.2.3



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