After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 309178 - Small leak in main.c
Small leak in main.c
Status: RESOLVED FIXED
Product: metacity
Classification: Other
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Metacity maintainers list
Metacity maintainers list
Depends on:
Blocks:
 
 
Reported: 2005-06-28 11:22 UTC by Kjartan Maraas
Modified: 2006-01-10 04:18 UTC
See Also:
GNOME target: ---
GNOME version: 2.11/2.12


Attachments
proposed patch (497 bytes, patch)
2005-06-28 11:22 UTC, Kjartan Maraas
needs-work Details | Review
Plug the leaks (1.04 KB, patch)
2006-01-09 18:11 UTC, Elijah Newren
committed Details | Review

Description Kjartan Maraas 2005-06-28 11:22:09 UTC
Attaching a patch
Comment 1 Kjartan Maraas 2005-06-28 11:22:59 UTC
Created attachment 48441 [details] [review]
proposed patch
Comment 2 Havoc Pennington 2005-07-14 23:19:15 UTC
Comment on attachment 48441 [details] [review]
proposed patch

thanks
Comment 3 Luis Villa 2005-07-21 20:58:27 UTC
confirming to get off my radar. Sorry for the spam.
Comment 4 Kjartan Maraas 2005-07-24 16:57:11 UTC
Looks like the code changed under me here. Just relevant for gnome-2-10 now? or
is it just a matter of s/save_file/meta_args.save_file/g on HEAD?
Comment 5 Elijah Newren 2005-07-24 21:09:57 UTC
I don't know.  Maybe Bjourn does as head made the relevant changes, though.
Comment 6 Björn Lindqvist 2005-07-30 22:34:12 UTC
Yes substitution should work. Also, the MetaArguments struct contain three items that potentially may need freeing: save_file, display_name, client_id. Maybe a destructor function to do the work? 
Comment 7 Kjartan Maraas 2006-01-08 16:45:57 UTC
Changing the patch status since it doesn't apply in it's current form.
Comment 8 Elijah Newren 2006-01-09 18:11:01 UTC
Created attachment 57053 [details] [review]
Plug the leaks

Okay, so after reading through the code and the GOption API documentation, I believe this plugs the three possible leaks.  Also, since GOption automatically calls g_set_prgname() as a side effect of calling g_option_context_parse (), I removed our explicit call to it that isn't needed anymore.
Comment 9 Havoc Pennington 2006-01-10 02:53:59 UTC
Comment on attachment 57053 [details] [review]
Plug the leaks

Looks fine to me, thanks
Comment 10 Elijah Newren 2006-01-10 04:18:18 UTC
2006-01-09  Elijah Newren  <newren@gmail.com>

	Plug a few leaks.  Fixes #309178.

	* src/main.c (main): remove an unneeded g_set_prgname() call, free
	some strings allocated by the GOptions parsing