=================================================================== RCS file: /cvs/mandoc/mandocdb.c,v retrieving revision 1.178 retrieving revision 1.181 diff -u -p -r1.178 -r1.181 --- mandoc/mandocdb.c 2014/12/05 16:18:14 1.178 +++ mandoc/mandocdb.c 2015/01/02 17:02:19 1.181 @@ -1,4 +1,4 @@ -/* $Id: mandocdb.c,v 1.178 2014/12/05 16:18:14 schwarze Exp $ */ +/* $Id: mandocdb.c,v 1.181 2015/01/02 17:02:19 schwarze Exp $ */ /* * Copyright (c) 2011, 2012 Kristaps Dzonsons * Copyright (c) 2011, 2012, 2013, 2014 Ingo Schwarze @@ -336,7 +336,7 @@ static const struct mdoc_handler mdocs[MDOC_MAX] = { int -main(int argc, char *argv[]) +mandocdb(int argc, char *argv[]) { int ch, i; size_t j, sz; @@ -350,7 +350,8 @@ main(int argc, char *argv[]) mpages_info.alloc = mlinks_info.alloc = hash_alloc; mpages_info.calloc = mlinks_info.calloc = hash_calloc; - mpages_info.free = mlinks_info.free = hash_free; + mpages_info.free = mlinks_info.free = hash_free; + mpages_info.data = mlinks_info.data = NULL; mpages_info.key_offset = offsetof(struct mpage, inodev); mlinks_info.key_offset = offsetof(struct mlink, file); @@ -852,6 +853,7 @@ filescan(const char *file) if (strlcpy(mlink->file, start, sizeof(mlink->file)) >= sizeof(mlink->file)) { say(start, "Filename too long"); + free(mlink); return; } @@ -1105,6 +1107,7 @@ mpages_merge(struct mparse *mp) str_info.alloc = hash_alloc; str_info.calloc = hash_calloc; str_info.free = hash_free; + str_info.data = NULL; str_info.key_offset = offsetof(struct str, key); if ( ! nodb)