Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/external/bsd/nvi/dist/ex CID 1132771: Fix memory leak



details:   https://anonhg.NetBSD.org/src/rev/e1d9ca95a98d
branches:  trunk
changeset: 791657:e1d9ca95a98d
user:      christos <christos%NetBSD.org@localhost>
date:      Wed Nov 27 18:08:06 2013 +0000

description:
CID 1132771: Fix memory leak

diffstat:

 external/bsd/nvi/dist/ex/ex_tag.c |  6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diffs (21 lines):

diff -r f9545cd3f11f -r e1d9ca95a98d external/bsd/nvi/dist/ex/ex_tag.c
--- a/external/bsd/nvi/dist/ex/ex_tag.c Wed Nov 27 18:06:28 2013 +0000
+++ b/external/bsd/nvi/dist/ex/ex_tag.c Wed Nov 27 18:08:06 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ex_tag.c,v 1.3 2013/11/25 22:43:46 christos Exp $ */
+/*     $NetBSD: ex_tag.c,v 1.4 2013/11/27 18:08:06 christos Exp $ */
 /*-
  * Copyright (c) 1992, 1993, 1994
  *     The Regents of the University of California.  All rights reserved.
@@ -810,8 +810,10 @@
         */
        if (TAILQ_EMPTY(&exp->tq)) {
                TAILQ_INSERT_HEAD(&exp->tq, rtqp, q);
-       } else
+       } else {
+               free(rtqp);
                rtqp = TAILQ_FIRST(&exp->tq);
+       }
 
        /* Link the new TAGQ structure into place. */
        TAILQ_INSERT_HEAD(&exp->tq, tqp, q);



Home | Main Index | Thread Index | Old Index