2006-12-07 Dan Williams <dcbw@redhat.com>

Patch from Christian Persch <chpe@gnome.org>

	* auth-dialog/main.c
		- Fix memleak by unrefing the GnomeProgram instance (Gnome.org #383123)


git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2175 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
This commit is contained in:
Dan Williams 2006-12-07 22:51:07 +00:00
parent 5721205385
commit 57e217b072
2 changed files with 17 additions and 8 deletions

View file

@ -1,3 +1,10 @@
2006-12-07 Dan Williams <dcbw@redhat.com>
Patch from Christian Persch <chpe@gnome.org>
* auth-dialog/main.c
- Fix memleak by unrefing the GnomeProgram instance (Gnome.org #383123)
2006-12-04 Dan Williams <dcbw@redhat.com>
* src/nm-vpnc-service.c

View file

@ -229,7 +229,8 @@ main (int argc, char *argv[])
static gchar *vpn_service = NULL;
GError *error = NULL;
GOptionContext *context;
static GOptionEntry entries[] =
GnomeProgram *program;
GOptionEntry entries[] =
{
{ "reprompt", 'r', 0, G_OPTION_ARG_NONE, &retry, "Reprompt for passwords", NULL},
{ "name", 'n', 0, G_OPTION_ARG_STRING, &vpn_name, "Name of VPN connection", NULL},
@ -246,8 +247,13 @@ main (int argc, char *argv[])
context = g_option_context_new ("- vpnc auth dialog");
g_option_context_add_main_entries (context, entries, GETTEXT_PACKAGE);
g_option_context_add_group (context, gtk_get_option_group (TRUE));
g_option_context_parse (context, &argc, &argv, &error);
program = gnome_program_init ("nm-vpnc-auth-dialog", VERSION,
LIBGNOMEUI_MODULE,
argc, argv,
GNOME_PARAM_GOPTION_CONTEXT, context,
GNOME_PARAM_NONE);
if (vpn_name == NULL || vpn_service == NULL) {
fprintf (stderr, "Have to supply both name and service\n");
@ -259,10 +265,6 @@ main (int argc, char *argv[])
goto out;
}
gnome_program_init ("nm-vpnc-auth-dialog", VERSION, LIBGNOMEUI_MODULE,
argc, argv,
GNOME_PARAM_NONE, GNOME_PARAM_NONE);
passwords = get_passwords (vpn_name, vpn_service, retry);
if (passwords == NULL)
goto out;
@ -283,7 +285,7 @@ main (int argc, char *argv[])
fread (buf, sizeof (char), sizeof (buf), stdin);
out:
g_option_context_free (context);
g_object_unref (program);
return passwords != NULL ? 0 : 1;
}