summaryrefslogtreecommitdiffstats
path: root/mmain.c
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2009-03-09 13:35:09 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2009-03-09 13:35:09 +0000
commit028cb9cf2041bbee0ed488b669254a2a8bc9ccb9 (patch)
tree5ab2627228735e61d73e125ca0c30cbd81138c0d /mmain.c
parent79c252d0d501a7a16abd7ad9da42ff7440083ee4 (diff)
downloadmandoc-028cb9cf2041bbee0ed488b669254a2a8bc9ccb9.tar.gz
Fixed valgrind issues.VERSION.1.4.6
Diffstat (limited to 'mmain.c')
-rw-r--r--mmain.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/mmain.c b/mmain.c
index 11f11000..297ab0aa 100644
--- a/mmain.c
+++ b/mmain.c
@@ -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));
}