From 23c5b114a08a25aa328f42f87c2923240872bcb1 Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Fri, 28 Mar 2014 19:17:12 +0000 Subject: 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). --- mansearch.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'mansearch.c') diff --git a/mansearch.c b/mansearch.c index 2fb196c9..656dcad8 100644 --- a/mansearch.c +++ b/mansearch.c @@ -1,4 +1,4 @@ -/* $Id: mansearch.c,v 1.24 2014/03/23 12:11:18 schwarze Exp $ */ +/* $Id: mansearch.c,v 1.25 2014/03/28 19:17:12 schwarze Exp $ */ /* * Copyright (c) 2012 Kristaps Dzonsons * Copyright (c) 2013, 2014 Ingo Schwarze @@ -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; -- cgit v1.2.3-56-ge451