Fix CID 1491379: dereference before null check.
authorwwp <subscript@free.fr>
Wed, 6 Oct 2021 07:53:47 +0000 (09:53 +0200)
committerwwp <subscript@free.fr>
Wed, 6 Oct 2021 07:53:47 +0000 (09:53 +0200)
src/addrcustomattr.c

index a28e8c5cc0d5989817cf4d73fa0cb70bca1c9b7b..1293db27532dd3e145c7ee12e8618494e538db1a 100644 (file)
@@ -363,7 +363,8 @@ static void custom_attr_window_add_attr(void)
 {
        gchar *new_attr = gtk_editable_get_chars(GTK_EDITABLE(custom_attr_window.add_entry),
                                                                0, -1);
-       g_strstrip(new_attr);
+       if (new_attr)
+               g_strstrip(new_attr);
        if (new_attr && *new_attr) {
                GtkListStore *list_store = GTK_LIST_STORE(gtk_tree_view_get_model
                                                (GTK_TREE_VIEW(custom_attr_window.attr_list)));