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
=== modified file 'src/application-service-appstore.c'
--- src/application-service-appstore.c 2011-04-07 14:10:11 +0000
+++ src/application-service-appstore.c 2011-04-08 20:38:28 +0000
@@ -498,7 +498,8 @@
498 if (menu == NULL || id == NULL || category == NULL || status == NULL ||498 if (menu == NULL || id == NULL || category == NULL || status == NULL ||
499 icon_name == NULL) {499 icon_name == NULL) {
500 g_warning("Notification Item on object %s of %s doesn't have enough properties.", app->dbus_object, app->dbus_name);500 g_warning("Notification Item on object %s of %s doesn't have enough properties.", app->dbus_object, app->dbus_name);
501 g_free(app); // Need to do more than this, but it gives the idea of the flow we're going for.501 if (!app->validated)
502 application_free(app);
502 }503 }
503 else {504 else {
504 app->validated = TRUE;505 app->validated = TRUE;

Subscribers

People subscribed via source and target branches