Merge lp:~charlesk/ubuntuone-client-gnome/lp-981270 into lp:ubuntuone-client-gnome

Proposed by Charles Kerr on 2012-04-14
Status: Merged
Approved by: dobey on 2012-04-16
Approved revision: 15
Merged at revision: 15
Proposed branch: lp:~charlesk/ubuntuone-client-gnome/lp-981270
Merge into: lp:ubuntuone-client-gnome
Diff against target: 36 lines (+10/-3)
1 file modified
nautilus/file-watcher.c (+10/-3)
To merge this branch: bzr merge lp:~charlesk/ubuntuone-client-gnome/lp-981270
Reviewer Review Type Date Requested Status
Manuel de la Peña (community) 2012-04-14 Approve on 2012-04-16
dobey (community) 2012-04-16 Approve on 2012-04-16
Review via email: mp+101993@code.launchpad.net

Commit message

Don't leak the strings returned by nautilus_file_info_get_uri()

To post a comment you must log in.
dobey (dobey) :
review: Approve
Manuel de la Peña (mandel) wrote :

Looks good to me.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'nautilus/file-watcher.c'
2--- nautilus/file-watcher.c 2011-07-20 20:44:39 +0000
3+++ nautilus/file-watcher.c 2012-04-14 00:03:19 +0000
4@@ -264,10 +264,13 @@
5 static void
6 observed_file_unrefed (gpointer user_data, GObject *where_the_object_was)
7 {
8+ gchar *uri;
9 gchar *path;
10 FileWatcher *watcher = FILE_WATCHER (user_data);
11
12- path = g_filename_from_uri (nautilus_file_info_get_uri (NAUTILUS_FILE_INFO (where_the_object_was)), NULL, NULL);
13+ uri = nautilus_file_info_get_uri (NAUTILUS_FILE_INFO (where_the_object_was));
14+ path = g_filename_from_uri (uri, NULL, NULL);
15+ g_free (uri);
16
17 if (path == NULL)
18 return;
19@@ -282,12 +285,16 @@
20 file_watcher_add_file (FileWatcher *watcher, NautilusFileInfo *file)
21 {
22 gboolean is_root;
23- gchar *path = NULL;
24+ gchar *uri;
25+ gchar *path;
26 NautilusFileInfo *old_file;
27
28 g_return_if_fail (IS_FILE_WATCHER (watcher));
29
30- path = g_filename_from_uri (nautilus_file_info_get_uri (file), NULL, NULL);
31+ uri = nautilus_file_info_get_uri (file);
32+ path = g_filename_from_uri (uri, NULL, NULL);
33+ g_free (uri);
34+
35 if (path == NULL)
36 return;
37

Subscribers

People subscribed via source and target branches