[rhythmbox] MTP: Fix memory leak



commit e776656f399eb068f905cb28f8495764635d508d
Author: Martin Pitt <martin pitt ubuntu com>
Date:   Wed Apr 14 16:46:18 2010 +0200

    MTP: Fix memory leak
    
    Free the list returned by LIBMTP_Detect_Raw_Devices() after we are done with
    it.

 plugins/mtpdevice/rb-mtp-plugin.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
---
diff --git a/plugins/mtpdevice/rb-mtp-plugin.c b/plugins/mtpdevice/rb-mtp-plugin.c
index e5ca327..6df8746 100644
--- a/plugins/mtpdevice/rb-mtp-plugin.c
+++ b/plugins/mtpdevice/rb-mtp-plugin.c
@@ -386,9 +386,11 @@ create_source_device_cb (RBRemovableMediaManager *rmm, GObject *device_obj, RBMt
 			g_signal_connect_object (G_OBJECT (source),
 						"deleted", G_CALLBACK (source_deleted_cb),
 						plugin, 0);
+			free (raw_devices);
 			return source;
 		}
 	}
+	free (raw_devices);
 
 	rb_debug ("device didn't match anything");
 	return NULL;



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