<URL: http://bugs.freeciv.org/Ticket/Display.html?id=39570 >

William Allen Simpson wrote:
> So, we're looking for some bogon committed to both trunk and S2_1 recently.
> 
Found it!  Bad patch from PR#39507.

Took inf_close() out of section_file_read_dup(), but forgot the very first
thing that section_file_read_dup() did was check inf for NULL....

Big slap with a wet noodle!





Index: utility/registry.c
===================================================================
--- utility/registry.c  (revision 13331)
+++ utility/registry.c  (working copy)
@@ -434,9 +434,6 @@
   struct astring_vector columns;    /* astrings for column headings */
   bool found_my_section = FALSE;
 
-  if (!inf) {
-    return FALSE;
-  }
   section_file_init(sf);
   if (filename) {
     sf->filename = mystrdup(filename);
@@ -663,6 +660,9 @@
   interpret_tilde(real_filename, sizeof(real_filename), filename);
   inf = inf_from_file(real_filename, datafilename);
 
+  if (!inf) {
+    return FALSE;
+  }
   success = section_file_read_dup(my_section_file, real_filename,
                                   inf, TRUE, part);
 
@@ -684,6 +684,9 @@
   interpret_tilde(real_filename, sizeof(real_filename), filename);
   inf = inf_from_file(real_filename, datafilename);
 
+  if (!inf) {
+    return FALSE;
+  }
   success = section_file_read_dup(my_section_file, real_filename,
                               inf, FALSE, NULL);
 
@@ -701,6 +704,9 @@
   bool success;
   struct inputfile *inf = inf_from_stream(stream, datafilename);
 
+  if (!inf) {
+    return FALSE;
+  }
   success = section_file_read_dup(my_section_file, NULL, inf, TRUE, NULL);
 
   inf_close(inf);
_______________________________________________
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev

Reply via email to