diff options
author | Niall O'Higgins <niallo@cvs.openbsd.org> | 2006-07-08 07:48:59 +0000 |
---|---|---|
committer | Niall O'Higgins <niallo@cvs.openbsd.org> | 2006-07-08 07:48:59 +0000 |
commit | ba11923262a1761e61f0019cb36fa01ac42ebf1d (patch) | |
tree | a2465740c7e5098e93ad9ab5d503d52560aa6817 /usr.bin/rcs/rcs.c | |
parent | 949b0b94313ca34540a774360f30f8e9a238a1d3 (diff) |
- plug an old memory leak in patching code.
ok joris@
Diffstat (limited to 'usr.bin/rcs/rcs.c')
-rw-r--r-- | usr.bin/rcs/rcs.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/usr.bin/rcs/rcs.c b/usr.bin/rcs/rcs.c index ca0dc11eaf8..b7c79b8c8ed 100644 --- a/usr.bin/rcs/rcs.c +++ b/usr.bin/rcs/rcs.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rcs.c,v 1.20 2006/06/11 22:25:35 niallo Exp $ */ +/* $OpenBSD: rcs.c,v 1.21 2006/07/08 07:48:58 niallo Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org> * All rights reserved. @@ -1082,6 +1082,9 @@ rcs_patch_lines(struct rcs_lines *dlines, struct rcs_lines *plines) for (i = 0; (i < nbln) && (dlp != NULL); i++) { ndlp = TAILQ_NEXT(dlp, l_list); TAILQ_REMOVE(&(dlines->l_lines), dlp, l_list); + if (dlp->l_line != NULL) + xfree(dlp->l_line); + xfree(dlp); dlp = ndlp; /* last line is gone - reset dlp */ if (dlp == NULL) { |