From 9eb56f151cd98dd80713baf89729bf6bf5ab28fb Mon Sep 17 00:00:00 2001 From: Elijah Newren Date: Tue, 10 Jan 2006 04:18:09 +0000 Subject: [PATCH] Plug a few leaks. Fixes #309178. 2006-01-09 Elijah Newren 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 --- ChangeLog | 7 +++++++ src/main.c | 12 ++++++++++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 81a3458b7..c60d5ea9e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2006-01-09 Elijah Newren + + 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 + 2006-01-02 Elijah Newren Patch from Björn Lindqvist to fix a logic error. #322149. diff --git a/src/main.c b/src/main.c index 25ec9e4dc..39cd6d4f9 100644 --- a/src/main.c +++ b/src/main.c @@ -330,8 +330,6 @@ main (int argc, char **argv) sigset_t empty_mask; MetaArguments meta_args; - g_set_prgname (argv[0]); - if (setlocale (LC_ALL, "") == NULL) meta_warning ("Locale not understood by C library, internationalization will not work\n"); @@ -462,6 +460,16 @@ main (int argc, char **argv) */ if (!meta_args.disable_sm) meta_session_init (meta_args.client_id, meta_args.save_file); + + /* Free memory possibly allocated by the argument parsing which are + * no longer needed. + */ + if (meta_args.save_file) + g_free (meta_args.save_file); + if (meta_args.display_name) + g_free (meta_args.display_name); + if (meta_args.client_id) + g_free (meta_args.client_id); if (!meta_display_open (NULL)) meta_exit (META_EXIT_ERROR);