diff options
-rw-r--r-- | plugins/exec/exec_plugin.c | 2 | ||||
-rw-r--r-- | plugins/nx/nx_session.c | 5 | ||||
-rw-r--r-- | plugins/rdp/rdp_cliprdr.h | 2 | ||||
-rw-r--r-- | plugins/rdp/rdp_event.c | 12 | ||||
-rw-r--r-- | plugins/rdp/rdp_plugin.c | 4 | ||||
-rw-r--r-- | src/rcw.c | 7 | ||||
-rw-r--r-- | src/remmina.c | 2 | ||||
-rw-r--r-- | src/remmina_external_tools.h | 2 | ||||
-rw-r--r-- | src/remmina_file.h | 2 | ||||
-rw-r--r-- | src/remmina_ftp_client.c | 20 | ||||
-rw-r--r-- | src/remmina_key_chooser.c | 12 | ||||
-rw-r--r-- | src/remmina_main.c | 5 | ||||
-rw-r--r-- | src/remmina_pref_dialog.c | 1 | ||||
-rw-r--r-- | src/remmina_protocol_widget.h | 4 | ||||
-rw-r--r-- | src/remmina_public.h | 2 | ||||
-rw-r--r-- | src/remmina_scrolled_viewport.c | 2 | ||||
-rw-r--r-- | src/remmina_ssh.c | 3 | ||||
-rw-r--r-- | src/remmina_ssh_plugin.h | 6 | ||||
-rw-r--r-- | src/remmina_stats_sender.c | 1 | ||||
-rw-r--r-- | src/remmina_unlock.c | 2 | ||||
-rw-r--r-- | src/remmina_utils.c | 3 | ||||
-rw-r--r-- | src/rmnews.c | 8 |
22 files changed, 56 insertions, 51 deletions
diff --git a/plugins/exec/exec_plugin.c b/plugins/exec/exec_plugin.c index 6284b44df..d7308cd4e 100644 --- a/plugins/exec/exec_plugin.c +++ b/plugins/exec/exec_plugin.c @@ -164,8 +164,8 @@ static gboolean remmina_plugin_exec_run(RemminaProtocolWidget *gp) if (error) { gtk_text_buffer_set_text (gpdata->log_buffer, error->message, -1); remmina_plugin_service->protocol_plugin_signal_connection_opened(gp); - return TRUE; g_error_free(error); + return TRUE; } if (remmina_plugin_service->file_get_int(remminafile, "runasync", FALSE)) { diff --git a/plugins/nx/nx_session.c b/plugins/nx/nx_session.c index 4a2d299f3..e698e92fa 100644 --- a/plugins/nx/nx_session.c +++ b/plugins/nx/nx_session.c @@ -288,9 +288,8 @@ static gboolean remmina_nx_session_get_response(RemminaNXSession *nx) remmina_nx_session_set_application_error(nx, "Channel closed."); return FALSE; } - if (len > 0) { - g_string_append_len(nx->response, buffer, len); - } + + g_string_append_len(nx->response, buffer, len); g_free(buffer); return TRUE; diff --git a/plugins/rdp/rdp_cliprdr.h b/plugins/rdp/rdp_cliprdr.h index 82f59412d..5645141a7 100644 --- a/plugins/rdp/rdp_cliprdr.h +++ b/plugins/rdp/rdp_cliprdr.h @@ -43,7 +43,7 @@ void remmina_rdp_clipboard_init(rfContext *rfi); void remmina_rdp_clipboard_free(rfContext *rfi); -void remmina_rdp_cliprdr_init(rfContext *rfc, CliprdrClientContext *cliprdr); +void remmina_rdp_cliprdr_init(rfContext *rfi, CliprdrClientContext *cliprdr); void remmina_rdp_channel_cliprdr_process(RemminaProtocolWidget *gp, wMessage *event); void remmina_rdp_event_process_clipboard(RemminaProtocolWidget *gp, RemminaPluginRdpUiObject *ui); CLIPRDR_FORMAT_LIST *remmina_rdp_cliprdr_get_client_format_list(RemminaProtocolWidget *gp); diff --git a/plugins/rdp/rdp_event.c b/plugins/rdp/rdp_event.c index 7757e1881..7da781f2c 100644 --- a/plugins/rdp/rdp_event.c +++ b/plugins/rdp/rdp_event.c @@ -905,8 +905,12 @@ static void remmina_rdp_event_create_cairo_surface(rfContext* rfi) int stride; rdpGdi* gdi; + if (!rfi) + return; + gdi = ((rdpContext *)rfi)->gdi; - if (!rfi || !gdi) + + if (!gdi) return; if (rfi->surface) { @@ -937,10 +941,8 @@ void remmina_rdp_event_update_scale(RemminaProtocolWidget* gp) if ( rfi->surface && (cairo_image_surface_get_width(rfi->surface) != gdi->width || cairo_image_surface_get_height(rfi->surface) != gdi->height) ) { /* Destroys and recreate rfi->surface with new width and height */ - if (rfi->surface) { - cairo_surface_destroy(rfi->surface); - rfi->surface = NULL; - } + cairo_surface_destroy(rfi->surface); + rfi->surface = NULL; remmina_rdp_event_create_cairo_surface(rfi); } else if ( rfi->surface == NULL ) { remmina_rdp_event_create_cairo_surface(rfi); diff --git a/plugins/rdp/rdp_plugin.c b/plugins/rdp/rdp_plugin.c index 3108aba30..9523f0e9b 100644 --- a/plugins/rdp/rdp_plugin.c +++ b/plugins/rdp/rdp_plugin.c @@ -436,8 +436,8 @@ static BOOL rf_keyboard_set_indicators(rdpContext *context, UINT16 led_flags) x11_display = gdk_x11_display_get_xdisplay(disp); XkbLockModifiers(x11_display, XkbUseCoreKbd, LockMask | Mod2Mask, - (led_flags & KBD_SYNC_CAPS_LOCK ? LockMask : 0) | - (led_flags & KBD_SYNC_NUM_LOCK ? Mod2Mask : 0) + ((led_flags & KBD_SYNC_CAPS_LOCK) ? LockMask : 0) | + ((led_flags & KBD_SYNC_NUM_LOCK) ? Mod2Mask : 0) ); /* ToDo: add support to KANA_LOCK and SCROLL_LOCK */ @@ -2919,9 +2919,10 @@ void rco_closewin(RemminaProtocolWidget *gp) gtk_notebook_page_num(cnnobj->cnnwin->priv->notebook, page_to_remove)); } } - - cnnobj->remmina_file = NULL; - g_free(cnnobj); + if (cnnobj) { + cnnobj->remmina_file = NULL; + g_free(cnnobj); + } remmina_application_condexit(REMMINA_CONDEXIT_ONDISCONNECT); } diff --git a/src/remmina.c b/src/remmina.c index bab3d757a..95c5ef692 100644 --- a/src/remmina.c +++ b/src/remmina.c @@ -322,7 +322,7 @@ int main(int argc, char *argv[]) #ifdef HAVE_LIBGCRYPT # if GCRYPT_VERSION_NUMBER < 0x010600 - gcry_error_t e; + gcry_error_t e; if (!gcrypt_thread_initialized) { if ((e = gcry_control(GCRYCTL_SET_THREAD_CBS, &gcry_threads_pthread)) != GPG_ERR_NO_ERROR) return -1; diff --git a/src/remmina_external_tools.h b/src/remmina_external_tools.h index 42610042f..f02ed555b 100644 --- a/src/remmina_external_tools.h +++ b/src/remmina_external_tools.h @@ -42,6 +42,6 @@ G_BEGIN_DECLS /* Open a new connection window for a .remmina file */ -gboolean remmina_external_tools_from_filename(RemminaMain *remminamain, gchar *filename); +gboolean remmina_external_tools_from_filename(RemminaMain *remminamain, gchar *remminafilename); G_END_DECLS diff --git a/src/remmina_file.h b/src/remmina_file.h index 548aca93e..5b994f6bd 100644 --- a/src/remmina_file.h +++ b/src/remmina_file.h @@ -91,6 +91,6 @@ void remmina_file_unsave_passwords(RemminaFile *remminafile); * taken from suckless sbase */ gchar *remmina_file_get_datetime(RemminaFile *remminafile); /* Function used to update the atime and mtime of a given remmina file */ -void remmina_file_touch(RemminaFile *remminafilefile); +void remmina_file_touch(RemminaFile *remminafile); G_END_DECLS diff --git a/src/remmina_ftp_client.c b/src/remmina_ftp_client.c index 41ada9f88..935afa8a0 100644 --- a/src/remmina_ftp_client.c +++ b/src/remmina_ftp_client.c @@ -265,16 +265,16 @@ static void remmina_ftp_client_cell_data_permission(GtkTreeViewColumn *col, GtkC gtk_tree_model_get(model, iter, REMMINA_FTP_FILE_COLUMN_PERMISSION, &permission, -1); - buf[0] = (permission & 040000 ? 'd' : '-'); - buf[1] = (permission & 0400 ? 'r' : '-'); - buf[2] = (permission & 0200 ? 'w' : '-'); - buf[3] = (permission & 0100 ? 'x' : '-'); - buf[4] = (permission & 040 ? 'r' : '-'); - buf[5] = (permission & 020 ? 'w' : '-'); - buf[6] = (permission & 010 ? 'x' : '-'); - buf[7] = (permission & 04 ? 'r' : '-'); - buf[8] = (permission & 02 ? 'w' : '-'); - buf[9] = (permission & 01 ? 'x' : '-'); + buf[0] = ((permission & 040000) ? 'd' : '-'); + buf[1] = ((permission & 0400) ? 'r' : '-'); + buf[2] = ((permission & 0200) ? 'w' : '-'); + buf[3] = ((permission & 0100) ? 'x' : '-'); + buf[4] = ((permission & 040) ? 'r' : '-'); + buf[5] = ((permission & 020) ? 'w' : '-'); + buf[6] = ((permission & 010) ? 'x' : '-'); + buf[7] = ((permission & 04) ? 'r' : '-'); + buf[8] = ((permission & 02) ? 'w' : '-'); + buf[9] = ((permission & 01) ? 'x' : '-'); buf[10] = '\0'; g_object_set(renderer, "text", buf, NULL); diff --git a/src/remmina_key_chooser.c b/src/remmina_key_chooser.c index d19fccda8..08e29b46b 100644 --- a/src/remmina_key_chooser.c +++ b/src/remmina_key_chooser.c @@ -88,12 +88,12 @@ gchar* remmina_key_chooser_get_value(guint keyval, guint state) return g_strdup(KEY_CHOOSER_NONE); return g_strdup_printf("%s%s%s%s%s%s%s", - state & GDK_SHIFT_MASK ? KEY_MODIFIER_SHIFT : "", - state & GDK_CONTROL_MASK ? KEY_MODIFIER_CTRL : "", - state & GDK_MOD1_MASK ? KEY_MODIFIER_ALT : "", - state & GDK_SUPER_MASK ? KEY_MODIFIER_SUPER : "", - state & GDK_HYPER_MASK ? KEY_MODIFIER_HYPER : "", - state & GDK_META_MASK ? KEY_MODIFIER_META : "", + (state & GDK_SHIFT_MASK) ? KEY_MODIFIER_SHIFT : "", + (state & GDK_CONTROL_MASK) ? KEY_MODIFIER_CTRL : "", + (state & GDK_MOD1_MASK) ? KEY_MODIFIER_ALT : "", + (state & GDK_SUPER_MASK) ? KEY_MODIFIER_SUPER : "", + (state & GDK_HYPER_MASK) ? KEY_MODIFIER_HYPER : "", + (state & GDK_META_MASK) ? KEY_MODIFIER_META : "", gdk_keyval_name(gdk_keyval_to_upper(keyval))); } diff --git a/src/remmina_main.c b/src/remmina_main.c index 644d9f856..3c0ba293f 100644 --- a/src/remmina_main.c +++ b/src/remmina_main.c @@ -1226,13 +1226,12 @@ static void remmina_main_init(void) }else { gtk_window_set_title(remminamain->window, _("Remmina Kiosk")); } - if (!kioskmode && kioskmode == FALSE) + if (!kioskmode && kioskmode == FALSE) { gtk_window_set_default_size(remminamain->window, remmina_pref.main_width, remmina_pref.main_height); - if (!kioskmode && kioskmode == FALSE) if (remmina_pref.main_maximize) { gtk_window_maximize(remminamain->window); } - + } /* Honor global peferences Search Bar visibility */ if (remmina_pref.hide_searchbar) gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(RM_GET_OBJECT("search_toggle")), FALSE); diff --git a/src/remmina_pref_dialog.c b/src/remmina_pref_dialog.c index 32deb88eb..dd048358b 100644 --- a/src/remmina_pref_dialog.c +++ b/src/remmina_pref_dialog.c @@ -343,7 +343,6 @@ void remmina_pref_on_dialog_destroy(GtkWidget *widget, gpointer user_data) gtk_color_chooser_get_rgba(GTK_COLOR_CHOOSER(remmina_pref_dialog->colorbutton_color15), &color); remmina_pref.color_pref.color15 = gdk_rgba_to_string(&color); remmina_pref.vte_lines = atoi(gtk_entry_get_text(remmina_pref_dialog->entry_scrollback_lines)); - remmina_pref.vte_lines = atoi(gtk_entry_get_text(remmina_pref_dialog->entry_scrollback_lines)); remmina_pref.vte_shortcutkey_copy = remmina_key_chooser_get_keyval(gtk_button_get_label(remmina_pref_dialog->button_keyboard_copy)); remmina_pref.vte_shortcutkey_paste = remmina_key_chooser_get_keyval(gtk_button_get_label(remmina_pref_dialog->button_keyboard_paste)); remmina_pref.vte_shortcutkey_select_all = remmina_key_chooser_get_keyval(gtk_button_get_label(remmina_pref_dialog->button_keyboard_select_all)); diff --git a/src/remmina_protocol_widget.h b/src/remmina_protocol_widget.h index e5c22a451..f4224f2ce 100644 --- a/src/remmina_protocol_widget.h +++ b/src/remmina_protocol_widget.h @@ -107,7 +107,7 @@ gboolean remmina_protocol_widget_query_feature_by_ref(RemminaProtocolWidget *gp, void remmina_protocol_widget_call_feature_by_type(RemminaProtocolWidget *gp, RemminaProtocolFeatureType type, gint id); void remmina_protocol_widget_call_feature_by_ref(RemminaProtocolWidget *gp, const RemminaProtocolFeature *feature); /* Provide thread-safe way to emit signals */ -void remmina_protocol_widget_emit_signal(RemminaProtocolWidget *gp, const gchar *signal); +void remmina_protocol_widget_emit_signal(RemminaProtocolWidget *gp, const gchar *signal_name); void remmina_protocol_widget_register_hostkey(RemminaProtocolWidget *gp, GtkWidget *widget); typedef gboolean (*RemminaHostkeyFunc)(RemminaProtocolWidget *gp, guint keyval, gboolean release); @@ -156,7 +156,7 @@ gchar *remmina_protocol_widget_get_clientkey(RemminaProtocolWidget *gp); void remmina_protocol_widget_chat_open(RemminaProtocolWidget *gp, const gchar *name, void (*on_send)(RemminaProtocolWidget *gp, const gchar *text), void (*on_destroy)(RemminaProtocolWidget *gp)); void remmina_protocol_widget_chat_close(RemminaProtocolWidget *gp); void remmina_protocol_widget_chat_receive(RemminaProtocolWidget *gp, const gchar *text); -void remmina_protocol_widget_send_keys_signals(GtkWidget *widget, const guint *keyvals, int length, GdkEventType action); +void remmina_protocol_widget_send_keys_signals(GtkWidget *widget, const guint *keyvals, int keyvals_length, GdkEventType action); /* Check if the plugin accepts keystrokes */ gboolean remmina_protocol_widget_plugin_receives_keystrokes(RemminaProtocolWidget *gp); /* Send to the plugin some keystrokes */ diff --git a/src/remmina_public.h b/src/remmina_public.h index 8b3485799..9404084b6 100644 --- a/src/remmina_public.h +++ b/src/remmina_public.h @@ -75,7 +75,7 @@ GtkWidget *remmina_public_create_combo(gboolean use_icon); GtkWidget *remmina_public_create_combo_map(const gpointer *key_value_list, const gchar *def, gboolean use_icon, const gchar *domain); GtkWidget *remmina_public_create_combo_mapint(const gpointer *key_value_list, gint def, gboolean use_icon, const gchar *domain); -void remmina_public_create_group(GtkGrid *table, const gchar *group, gint row, gint rows, gint cols); +void remmina_public_create_group(GtkGrid *grid, const gchar *group, gint row, gint rows, gint cols); gchar *remmina_public_combo_get_active_text(GtkComboBox *combo); diff --git a/src/remmina_scrolled_viewport.c b/src/remmina_scrolled_viewport.c index ec3f84c45..aa4bbf68b 100644 --- a/src/remmina_scrolled_viewport.c +++ b/src/remmina_scrolled_viewport.c @@ -84,7 +84,7 @@ static gboolean remmina_scrolled_viewport_motion_timeout(gpointer data) if (!GTK_IS_BIN(data)) return FALSE; gsv = REMMINA_SCROLLED_VIEWPORT(data); - if (!gsv->viewport_motion) + if (!gsv || !gsv->viewport_motion) return FALSE; child = gtk_bin_get_child(GTK_BIN(gsv)); if (!GTK_IS_VIEWPORT(child)) diff --git a/src/remmina_ssh.c b/src/remmina_ssh.c index c4da45ff7..63b1e858b 100644 --- a/src/remmina_ssh.c +++ b/src/remmina_ssh.c @@ -1212,7 +1212,8 @@ remmina_ssh_tunnel_main_thread_proc(gpointer data) case REMMINA_SSH_TUNNEL_OPEN: sock = remmina_ssh_tunnel_accept_local_connection(tunnel, TRUE); if (sock < 0) { - tunnel->thread = 0; + if (tunnel) + tunnel->thread = 0; return NULL; } diff --git a/src/remmina_ssh_plugin.h b/src/remmina_ssh_plugin.h index 7cb9401ba..18529da79 100644 --- a/src/remmina_ssh_plugin.h +++ b/src/remmina_ssh_plugin.h @@ -56,9 +56,9 @@ typedef struct _RemminaProtocolSettingOpt { /* For callback in main thread */ #if defined (HAVE_LIBSSH) && defined (HAVE_LIBVTE) void remmina_plugin_ssh_vte_terminal_set_encoding_and_pty(VteTerminal *terminal, const char *codeset, int master, int slave); -void remmina_plugin_ssh_vte_select_all(GtkMenuItem *menuitem, gpointer user_data); -void remmina_plugin_ssh_vte_copy_clipboard(GtkMenuItem *menuitem, gpointer user_data); -void remmina_plugin_ssh_vte_paste_clipboard(GtkMenuItem *menuitem, gpointer user_data); +void remmina_plugin_ssh_vte_select_all(GtkMenuItem *menuitem, gpointer vte); +void remmina_plugin_ssh_vte_copy_clipboard(GtkMenuItem *menuitem, gpointer vte); +void remmina_plugin_ssh_vte_paste_clipboard(GtkMenuItem *menuitem, gpointer vte); gboolean remmina_ssh_plugin_popup_menu(GtkWidget *widget, GdkEvent *event, GtkWidget *menu); #endif diff --git a/src/remmina_stats_sender.c b/src/remmina_stats_sender.c index c78304719..e5cd509b0 100644 --- a/src/remmina_stats_sender.c +++ b/src/remmina_stats_sender.c @@ -213,6 +213,7 @@ static gboolean remmina_stats_collector_done(gpointer data) g_free(unenc_s); ERR_free_strings(); g_free(data); + g_free(uid); return G_SOURCE_REMOVE; } diff --git a/src/remmina_unlock.c b/src/remmina_unlock.c index 9f20466da..63d051afa 100644 --- a/src/remmina_unlock.c +++ b/src/remmina_unlock.c @@ -113,7 +113,7 @@ gint remmina_unlock_new(GtkWindow *parent) TRACE_CALL(__func__); gdouble unlock_timeout; - gdouble elapsed; + gdouble elapsed = 0.0; gboolean lock = TRUE; unlock_timeout = remmina_pref.unlock_timeout; diff --git a/src/remmina_utils.c b/src/remmina_utils.c index 725ce5f65..cf4212510 100644 --- a/src/remmina_utils.c +++ b/src/remmina_utils.c @@ -441,6 +441,8 @@ const gchar* remmina_utils_get_os_info() remmina_utils_get_kernel_release(), remmina_utils_get_kernel_arch()); if (!kernel_string || kernel_string[0] == '\0') + if(kernel_string) + g_free(kernel_string); kernel_string = g_strdup_printf("%s;%s;%s\n", "UNKNOWN", "UNKNOWN", @@ -531,4 +533,3 @@ gchar* remmina_gen_random_uuid() return result; } - diff --git a/src/rmnews.c b/src/rmnews.c index 16dcf57fc..d5a66aefb 100644 --- a/src/rmnews.c +++ b/src/rmnews.c @@ -148,6 +148,7 @@ static gchar *rmnews_get_file_contents(gchar *path) if (!g_utf8_validate(content, size, NULL)) { g_warning("%s content is not UTF-8", path); g_free(content); + content = NULL; } } //return g_markup_escape_text(content, strlen(content)); @@ -159,7 +160,7 @@ static void rmnews_close_clicked(GtkButton *btn, gpointer user_data) TRACE_CALL(__func__); gtk_widget_destroy(GTK_WIDGET(rmnews_news_dialog->dialog)); rmnews_news_dialog->dialog = NULL; - g_free(rmnews_news_dialog->dialog); + g_free(rmnews_news_dialog); rmnews_news_dialog = NULL; } @@ -167,6 +168,7 @@ static void rmnews_close_clicked(GtkButton *btn, gpointer user_data) static gboolean rmnews_dialog_deleted(GtkButton *btn, gpointer user_data) { TRACE_CALL(__func__); + gtk_widget_destroy(GTK_WIDGET(rmnews_news_dialog->dialog)); rmnews_news_dialog->dialog = NULL; g_free(rmnews_news_dialog->dialog); rmnews_news_dialog = NULL; @@ -327,10 +329,10 @@ static void rmnews_get_url_cb(SoupSession *session, SoupMessage *msg, gpointer d if (output_file) { fwrite(sb->data, 1, sb->length, output_file); - if (output_file_path) + if (output_file_path) { fclose(output_file); - if (output_file_path) filesha_after = remmina_sha1_file(output_file_path); + } g_info("SHA1 after download is %s", filesha_after); if (g_strcmp0(filesha, filesha_after) != 0) { g_info("SHA1 differs, we show the news and reset the counter"); |