Skip to content
  • Per Cederqvist's avatar
    Fixed various harmless memory and file descriptor leaks found by · afb8f103
    Per Cederqvist authored
    valgrind.
    * src/server/testsuite/lyskomd.supp: Added aid_lexer_2.
    * src/server/testsuite/lyskomd.0/regexp-match-cov.exp (shutdown):
    Don't expect any suppressed leaked blocks.
    * src/server/testsuite/lyskomd.0/aux-items-cov.exp: Expect less
    suppressed leaked blocks.
    * src/server/testsuite/lyskomd.0/37.exp: Adjusted to new report
    format when configuration errors are found.
    * src/server/testsuite/lyskomd.0/conf-file-cov.exp: Ditto.
    * src/server/simple-cache.c (free_all_cache): Close text_file and
    file_a.
    * src/server/testsuite/lyskomd.supp: Removed i_fopen-2.3.1 and
    i_fopen-2.3.5, which were actually caused by the above problem.
    * src/server/server-config.c (read_configuration): Check the
    return value of read_config().  Free the configuration before
    calling restart_kom if there are any problems with the
    configuration.  Report the name of the configuation file if
    problems are found.
    * src/server/ramkomd.c (dump_exit_statistics): Call clear_info()
    instead of free_kom_info.
    (free_kom_info): Removed.  The new clear_info() function contains
    a better implementation, with less code duplication.
    * src/server/memory.c, src/server/kom-memory.h (clear_info): New
    function.
    * src/server/dbck.c (free_person_scratchpad): New static function.
    (free_person_scratch): Ditto.
    (main): Call free_person_scratch(), clear_info(),
    free_configuration() and free_all_dbck_cache() when terminating to
    make it possible to check for leaks with valgrind.
    * src/server/dbck-cache.c, src/server/dbck-cache.h
    (free_all_dbck_cache): New function.
    * src/server/conf-file.c, src/server/conf-file.h (read_config):
    Changed return type from void to Success.  Return FAILURE instead
    of calling restart_kom when configuration errors are found.
    afb8f103