From 8acb3c90fb3c3f33d986c8a11474138a497e1ec9 Mon Sep 17 00:00:00 2001 From: Kristaps Dzonsons Date: Mon, 9 Mar 2009 13:35:09 +0000 Subject: Fixed valgrind issues. --- mmain.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'mmain.c') diff --git a/mmain.c b/mmain.c index ccadcaeb..f278aebf 100644 --- a/mmain.c +++ b/mmain.c @@ -1,4 +1,4 @@ - /* $Id: mmain.c,v 1.10 2009/03/09 13:04:01 kristaps Exp $ */ + /* $Id: mmain.c,v 1.11 2009/03/09 13:35:09 kristaps Exp $ */ /* * Copyright (c) 2008 Kristaps Dzonsons * @@ -312,18 +312,19 @@ parse(struct mmain *p) } ln[pos] = 0; - if ( ! mdoc_parseln(p->mdoc, lnn, ln)) + if ( ! mdoc_parseln(p->mdoc, lnn, ln)) { + free(ln); return(0); + } lnn++; pos = 0; } } - if (pos > 0) - warnx("%s: file not eof-terminated", p->in); - if (ln) free(ln); + if (pos > 0) + warnx("%s: file not eof-terminated", p->in); return(mdoc_endparse(p->mdoc)); } -- cgit v1.2.3