--- a/busybox-1.10.1/networking/ifupdown.c      2008-04-19 00:50:27.000000000 -0300
+++ b/busybox-1.10.1/networking/ifupdown.c      2008-08-27 12:11:50.000000000 -0300
@@ -1261,14 +1261,16 @@

                        /* Actually write the new state */
                        state_fp = xfopen(CONFIG_IFUPDOWN_IFSTATE_PATH, "w");
-                       state = state_list;
-                       while (state) {
-                               if (state->data) {
-                                       fprintf(state_fp, "%s\n", state->data);
+                       if(state_fp) {
+                               state = state_list;
+                               while (state) {
+                                       if (state->data) {
+                                               fprintf(state_fp, "%s\n", state->data);
+                                       }
+                                       state = state->link;
                                }
-                               state = state->link;
+                               fclose(state_fp);
                        }
-                       fclose(state_fp);
                        llist_free(state_list, free);
                }
        }
