mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-02-08 19:40:34 +01:00
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 #383110) git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2174 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
This commit is contained in:
parent
d657bc13a5
commit
5721205385
2 changed files with 19 additions and 10 deletions
|
|
@ -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 #383110)
|
||||
|
||||
2006-12-07 Dan Williams <dcbw@redhat.com>
|
||||
|
||||
Patch from Christian Persch <chpe@gnome.org>
|
||||
|
|
|
|||
|
|
@ -327,8 +327,9 @@ main (int argc, char *argv[])
|
|||
static gchar *vpn_service = NULL;
|
||||
GError *error = NULL;
|
||||
GOptionContext *context;
|
||||
GnomeProgram *program = NULL;
|
||||
int bytes_read;
|
||||
static GOptionEntry entries[] =
|
||||
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},
|
||||
|
|
@ -345,8 +346,12 @@ main (int argc, char *argv[])
|
|||
|
||||
context = g_option_context_new ("- openvpn 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-openvpn-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");
|
||||
|
|
@ -358,11 +363,6 @@ main (int argc, char *argv[])
|
|||
goto out;
|
||||
}
|
||||
|
||||
gnome_program_init ("nm-openvpn-auth-dialog", VERSION, LIBGNOMEUI_MODULE,
|
||||
argc, argv,
|
||||
GNOME_PARAM_NONE, GNOME_PARAM_NONE);
|
||||
|
||||
|
||||
gconf_client = gconf_client_get_default();
|
||||
escaped_name = gconf_escape_key (vpn_name, strlen (vpn_name));
|
||||
gconf_key = g_strdup_printf ("%s/%s/vpn_data", GCONF_PATH_VPN_CONNECTIONS, escaped_name);
|
||||
|
|
@ -435,8 +435,10 @@ main (int argc, char *argv[])
|
|||
bytes_read = fread (buf, sizeof (char), sizeof (buf), stdin);
|
||||
|
||||
out:
|
||||
g_object_unref (gconf_client);
|
||||
g_option_context_free (context);
|
||||
if (gconf_client)
|
||||
g_object_unref (gconf_client);
|
||||
|
||||
g_object_unref (program);
|
||||
|
||||
g_free (connection_type);
|
||||
g_free (key);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue