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

Proposed by Niclas Lockner
Status: Merged
Approved by: David Gomes
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 (community) Approve
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

Fix use-after-free

Revision history for this message
David Gomes (davidgomes) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/fm-directory-view.c'
2--- src/fm-directory-view.c 2013-12-03 20:38:05 +0000
3+++ src/fm-directory-view.c 2014-01-11 05:05:18 +0000
4@@ -1872,14 +1872,15 @@
5 const char *id1, *id2;
6
7 id2 = g_app_info_get_id (default_app);
8- for (l=apps; l != NULL; l=l->next) {
9+ for (l = apps; l != NULL; l = l->next) {
10 app = (GAppInfo *) l->data;
11 id1 = g_app_info_get_id (app);
12 if (id1 != NULL && id2 != NULL
13 && strcmp (id1, id2) == 0)
14 {
15- g_object_unref (app);
16+ g_object_unref (app);
17 apps = g_list_delete_link (apps, l);
18+ break;
19 }
20 }
21
22@@ -1900,6 +1901,7 @@
23 if (executable != NULL && strcmp (executable, APP_NAME) == 0) {
24 g_object_unref (app);
25 apps = g_list_delete_link (apps, l);
26+ break;
27 }
28 }
29

Subscribers

People subscribed via source and target branches

to all changes: