Opened 8 years ago

Closed 8 years ago

#13162 closed patch (fixed)

gtkblist.c has memory leaks relating to gtk_tree_model_get_value

Reported by: NaderM Owned by:
Milestone: 2.7.10 Component: libpurple
Version: 2.7.9 Keywords: gtkblist.c memory leak
Cc:

Description

In many places in gtkblist.c, gtk_tree_model_get_value is used without an aftermath g_value_unset() to free the memory.

I've attached a patch that replaces all uses of gtk_tree_model_get_value with gtk_tree_model_get, which eliminates allocating memory and works directly on the target pointer.

Attachments (3)

gtkblist.c.diff (13.3 KB) - added by NaderM 8 years ago.
gtksourceundomanager.c.diff (760 bytes) - added by NaderM 8 years ago.
gtksourceiter.c.diff (899 bytes) - added by NaderM 8 years ago.

Download all attachments as: .zip

Change History (12)

Changed 8 years ago by NaderM

Changed 8 years ago by NaderM

comment:1 Changed 8 years ago by NaderM

I've also attached a patch for gtksourcemanager.c which I found a tiny potential memory leak in, as I'm in the process of stripping out changes from my own local branch for a clean patch to something bigger

comment:2 Changed 8 years ago by Robby

  • Milestone set to Patches Needing Review

comment:3 Changed 8 years ago by deryni

That gtksourceundomanager patch is something that, if correct, should be sent upstream as that code remains as-is there (though it has moved to a gtksourceundomanagerdefault.c file). Which brings up the question of whether we should see about updating our in-tree copy of the undo manager.

comment:4 Changed 8 years ago by NaderM

  • Summary changed from gtkblist.c has memoy leaks relating to gtk_tree_model_get_value to gtkblist.c has memory leaks relating to gtk_tree_model_get_value

Changed 8 years ago by NaderM

comment:5 Changed 8 years ago by NaderM

I've also added a fix relating to a small memory error when searching the logs and committed a patch upstream:

https://bugzilla.gnome.org/show_bug.cgi?id=638709

comment:6 Changed 8 years ago by morshed.nader@…

(In 62dca91b245f468607f6a3913abb28205511f869):
gtkblist: Fix a few memory leaks. Refs #13162.

comment:7 Changed 8 years ago by morshed.nader@…

(In c6f66fc01b05e7582a4e5074b75cf7d8bdb632c9):
gtksourceundomanager: Fix a few memory leaks in our bundled copy of this widget. Refs #13162.

comment:8 Changed 8 years ago by morshed.nader@…

(In 387760c8bb12bfb6c9bd7a5d8b4deb404ea27307):
gtksourceiter: Fix a few memory leaks in our bundled copy of this widget. Refs #13162.

comment:9 Changed 8 years ago by rekkanoryo@…

  • Milestone changed from Patches Needing Review to 2.7.10
  • Resolution set to fixed
  • Status changed from new to closed

(In 85e7b7db1a0f6770ffea92e171de90d309c603be):
Credit thundpressor for his patches. Fixes #13162.

Note: See TracTickets for help on using tickets.
All information, including names and email addresses, entered onto this website or sent to mailing lists affiliated with this website will be public. Do not post confidential information, especially passwords!