Commit 55bd5547 authored by Kyle Sanderson's avatar Kyle Sanderson

Fix small memory leaks and a NULL ptr dereference.

parent edea6994
......@@ -563,6 +563,7 @@ static void remmina_nx_session_send_command(RemminaNXSession *nx, const gchar *c
ssh_set_fd_towrite (nx->session);
ssh_channel_write (nx->channel, "\n", 1);
va_end(args);
}
gboolean remmina_nx_session_open(RemminaNXSession *nx, const gchar *server, guint port, const gchar *private_key_file,
......@@ -692,6 +693,7 @@ void remmina_nx_session_add_parameter(RemminaNXSession *nx, const gchar *name, c
va_start (args, valuefmt);
value = g_strdup_vprintf (valuefmt, args);
g_hash_table_insert(nx->session_parameters, g_strdup (name), value);
va_end(args);
}
static gboolean remmina_nx_session_send_session_command(RemminaNXSession *nx, const gchar *cmd_type, gint response)
......
......@@ -95,7 +95,11 @@ GtkWidget* remmina_applet_menu_item_new(RemminaAppletMenuItemType item_type, ...
gkeyfile = g_key_file_new();
if (!g_key_file_load_from_file(gkeyfile, item->filename, G_KEY_FILE_NONE, NULL))
{
g_key_file_free(gkeyfile);
va_end(ap);
return NULL;
}
item->name = g_key_file_get_string(gkeyfile, "remmina", "name", NULL);
item->group = g_key_file_get_string(gkeyfile, "remmina", "group", NULL);
......
......@@ -70,8 +70,6 @@ gboolean remmina_external_tools_from_filename(RemminaMain *remminamain, gchar* r
gchar filename[MAX_PATH_LEN];
GDir* dir;
const gchar* name;
GNode* root;
root = g_node_new(NULL);
strcpy(dirname, REMMINA_EXTERNAL_TOOLS_DIR);
dir = g_dir_open(dirname, 0, NULL);
......
......@@ -183,7 +183,10 @@ remmina_file_load(const gchar *filename)
gkeyfile = g_key_file_new();
if (!g_key_file_load_from_file(gkeyfile, filename, G_KEY_FILE_NONE, NULL))
{
g_key_file_free(gkeyfile);
return NULL;
}
if (g_key_file_has_key(gkeyfile, "remmina", "name", NULL))
{
......
......@@ -361,9 +361,11 @@ void remmina_public_get_server_port(const gchar *server, gint defaultport, gchar
ptr++;
ptr2 = strchr(ptr, ']');
if (ptr2)
{
*ptr2++ = '\0';
if (*ptr2 == ':')
defaultport = atoi(ptr2 + 1);
if (*ptr2 == ':')
defaultport = atoi(ptr2 + 1);
}
if (host)
*host = g_strdup(ptr);
if (port)
......@@ -386,6 +388,8 @@ void remmina_public_get_server_port(const gchar *server, gint defaultport, gchar
}
if (host)
*host = str;
else
g_free(str);
if (port)
*port = defaultport;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment