Fix a valgrind warning in unit test runner.
[apps/pfixtools.git] / postlicyd / tst-filters.c
index 1a8db8b..4dcbaa8 100644 (file)
@@ -62,6 +62,8 @@ static char *read_query(const char *basepath, const char *filename,
         if (end != NULL) {
             *end = buff + (map.end - map.map);
             **end = '\0';
+        } else {
+          buff[map.end - map.map] = '\0';
         }
         file_map_close(&map);
     }
@@ -200,8 +202,8 @@ int main(int argc, char *argv[])
 #define RM(File)                                                               \
       snprintf(path, FILENAME_MAX, "%s/%s", basepath, File);                   \
       unlink(path);
-      RM("test1_greylist.db");
-      RM("test1_whitelist.db");
+//      RM("test1_greylist.db");
+//      RM("test1_whitelist.db");
       RM("test2_greylist.db");
       RM("test2_whitelist.db");
 #undef RM