Merge lp:~mterry/indicator-application/dont-wildly-free-apps into lp:indicator-application/0.4

Proposed by Michael Terry
Status: Merged
Approved by: Ted Gould
Approved revision: 196
Merged at revision: 196
Proposed branch: lp:~mterry/indicator-application/dont-wildly-free-apps
Merge into: lp:indicator-application/0.4
Diff against target: 13 lines (+2/-1)
1 file modified
src/application-service-appstore.c (+2/-1)
To merge this branch: bzr merge lp:~mterry/indicator-application/dont-wildly-free-apps
Reviewer Review Type Date Requested Status
Ted Gould (community) Approve
Review via email: mp+57012@code.launchpad.net

Description of the change

In debugging bug 743564, which I'm not sure is 100% this same bug, I had a hard time seeing how it could happen unless an Application object weren't properly freed. I got a crash doing similar things with a wildly different stack but the same conclusion.

So I started looking at how we freed Applications. And lo and behold, at one point we just g_free it, instead of application_free! I don't know how likely this code branch is, but it is 100% a crash bug if we do hit it.

I further guarded the free with !app->validated because similar code a few lines up does if the callback had an error.

To post a comment you must log in.
Revision history for this message
Ted Gould (ted) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/application-service-appstore.c'
2--- src/application-service-appstore.c 2011-04-07 14:10:11 +0000
3+++ src/application-service-appstore.c 2011-04-08 20:38:28 +0000
4@@ -498,7 +498,8 @@
5 if (menu == NULL || id == NULL || category == NULL || status == NULL ||
6 icon_name == NULL) {
7 g_warning("Notification Item on object %s of %s doesn't have enough properties.", app->dbus_object, app->dbus_name);
8- g_free(app); // Need to do more than this, but it gives the idea of the flow we're going for.
9+ if (!app->validated)
10+ application_free(app);
11 }
12 else {
13 app->validated = TRUE;

Subscribers

People subscribed via source and target branches