add completion callback for overlay topology configure functions
[oweals/gnunet.git] / src / regex / regex_test_lib.c
index 0fc54e83fcadd6c27a7b611d35658f42fba43c97..7a11fe05ece16ac560a39558392736c95f4dbf7a 100644 (file)
@@ -224,6 +224,7 @@ GNUNET_REGEX_read_from_file (const char *filename)
   {
     GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
                 "Can't get size of file %s\n", filename);
+    GNUNET_DISK_file_close (f);
     return NULL;
   }
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
@@ -263,7 +264,9 @@ GNUNET_REGEX_read_from_file (const char *filename)
     GNUNET_array_grow (regexes, nr, nr + 1);
     regexes[nr - 2] = regex;
     regexes[nr - 1] = NULL;
+    regex = NULL;
   } while (offset < size);
+  GNUNET_free_non_null (regex);
   GNUNET_free (buffer);
 
   return regexes;