Merge lp:~niclasl/pantheon-files/fix-1252928 into lp:~elementary-apps/pantheon-files/trunk

Proposed by Niclas Lockner on 2014-01-11
Status: Merged
Approved by: David Gomes on 2014-01-14
Approved revision: 1407
Merged at revision: 1413
Proposed branch: lp:~niclasl/pantheon-files/fix-1252928
Merge into: lp:~elementary-apps/pantheon-files/trunk
Diff against target: 28 lines (+4/-2)
1 file modified
src/fm-directory-view.c (+4/-2)
To merge this branch: bzr merge lp:~niclasl/pantheon-files/fix-1252928
Reviewer Review Type Date Requested Status
David Gomes 2014-01-11 Approve on 2014-01-14
Review via email: mp+201276@code.launchpad.net

Commit message

Fix a use-after-free that is a potential cause of a segfault (bug #1252928).

Description of the change

Fix a use-after-free that is a potential cause of a segfault in the related bug

To post a comment you must log in.
1407. By Niclas Lockner on 2014-01-11

Fix use-after-free

David Gomes (davidgomes) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/fm-directory-view.c'
--- src/fm-directory-view.c 2013-12-03 20:38:05 +0000
+++ src/fm-directory-view.c 2014-01-11 05:05:18 +0000
@@ -1872,14 +1872,15 @@
1872 const char *id1, *id2;1872 const char *id1, *id2;
18731873
1874 id2 = g_app_info_get_id (default_app);1874 id2 = g_app_info_get_id (default_app);
1875 for (l=apps; l != NULL; l=l->next) {1875 for (l = apps; l != NULL; l = l->next) {
1876 app = (GAppInfo *) l->data;1876 app = (GAppInfo *) l->data;
1877 id1 = g_app_info_get_id (app);1877 id1 = g_app_info_get_id (app);
1878 if (id1 != NULL && id2 != NULL1878 if (id1 != NULL && id2 != NULL
1879 && strcmp (id1, id2) == 0)1879 && strcmp (id1, id2) == 0)
1880 {1880 {
1881 g_object_unref (app);1881 g_object_unref (app);
1882 apps = g_list_delete_link (apps, l);1882 apps = g_list_delete_link (apps, l);
1883 break;
1883 }1884 }
1884 }1885 }
18851886
@@ -1900,6 +1901,7 @@
1900 if (executable != NULL && strcmp (executable, APP_NAME) == 0) {1901 if (executable != NULL && strcmp (executable, APP_NAME) == 0) {
1901 g_object_unref (app);1902 g_object_unref (app);
1902 apps = g_list_delete_link (apps, l);1903 apps = g_list_delete_link (apps, l);
1904 break;
1903 }1905 }
1904 }1906 }
19051907

Subscribers

People subscribed via source and target branches

to all changes: