Index: gtkmain.c
===================================================================
--- gtkmain.c	(revision 21379)
+++ gtkmain.c	(working copy)
@@ -699,6 +699,10 @@ do_post_parse_initialization (int    *ar
       _gtk_modules_init (argc, argv, gtk_modules_string->str);
       g_string_free (gtk_modules_string, TRUE);
     }
+  else
+    {
+      _gtk_modules_init (argc, argv, NULL);
+    }
 }
 
 
Index: gtkmodules.c
===================================================================
--- gtkmodules.c	(revision 21379)
+++ gtkmodules.c	(working copy)
@@ -511,11 +511,13 @@ _gtk_modules_init (gint        *argc, 
 		    G_CALLBACK (display_opened_cb), 
 		    NULL);
 
-  /* Modules specified in the GTK_MODULES environment variable
-   * or on the command line are always loaded, so we'll just leak 
-   * the refcounts.
-   */
-  g_slist_free (load_modules (gtk_modules_args));
+  if (gtk_modules_args) {
+    /* Modules specified in the GTK_MODULES environment variable
+     * or on the command line are always loaded, so we'll just leak 
+     * the refcounts.
+     */
+    g_slist_free (load_modules (gtk_modules_args));
+  }
 }
 
 static void
