summaryrefslogtreecommitdiffstats
path: root/mansearch.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2014-03-28 19:17:12 +0000
committerIngo Schwarze <schwarze@openbsd.org>2014-03-28 19:17:12 +0000
commit3807ee23c5f7bfedf0aeb8a013b458325092265b (patch)
treed76b245c52f5f180e46dfbf8422f71b3ac691901 /mansearch.c
parentd82f070a5c49198d0d568df3940dfca1d933926d (diff)
downloadmandoc-3807ee23c5f7bfedf0aeb8a013b458325092265b.tar.gz
Properly initialize malloc(3)ed memory.
With this bug fix, partly unitialized memory could sometimes be returned, sometimes causing crashes by bogus free(3)s in apropos(1).
Diffstat (limited to 'mansearch.c')
-rw-r--r--mansearch.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/mansearch.c b/mansearch.c
index ff502daf..cfd14bf6 100644
--- a/mansearch.c
+++ b/mansearch.c
@@ -310,6 +310,7 @@ buildnames(struct manpage *mpage, sqlite3 *db, sqlite3_stmt *s,
size_t i;
int c;
+ mpage->file = NULL;
mpage->names = NULL;
prevsec = prevarch = NULL;
i = 1;