Fixes leak 26/26
authorSergio Villar Senin <svillar@igalia.com>
Tue, 17 Mar 2009 19:31:02 +0000 (19:31 +0000)
committerSergio Villar Senin <svillar@igalia.com>
Tue, 17 Mar 2009 19:31:02 +0000 (19:31 +0000)
Fixes NB#106346, coverity issues

pmo-trunk-r8127

src/hildon2/modest-hildon2-window.c

index a3d0433..34ec43d 100644 (file)
@@ -499,12 +499,13 @@ edit_toolbar_button_clicked (HildonEditToolbar *toolbar,
 
        reg = (EditModeRegister *) g_hash_table_lookup (priv->edit_mode_registry, 
                                                        GINT_TO_POINTER (priv->edit_command));
-       if (reg == NULL)
-               modest_hildon2_window_unset_edit_mode (self);
 
-       if ((reg->action == NULL) || reg->action (self))
+       if (reg) {
+               if ((reg->action == NULL) || reg->action (self))
+                       modest_hildon2_window_unset_edit_mode (self);
+       } else {
                modest_hildon2_window_unset_edit_mode (self);
-
+       }
 }
 
 static void