groff-commit
[Top][All Lists]
Advanced

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

[Groff-commit] groff ChangeLog src/roff/troff/node.cpp src/rof...


From: Werner LEMBERG
Subject: [Groff-commit] groff ChangeLog src/roff/troff/node.cpp src/rof...
Date: Fri, 10 Apr 2009 18:13:30 +0000

CVSROOT:        /cvsroot/groff
Module name:    groff
Changes by:     Werner LEMBERG <wl>     09/04/10 18:13:30

Modified files:
        .              : ChangeLog 
        src/roff/troff : node.cpp node.h 

Log message:
        Fix a memory leak in troff for -Thtml.
        Reported by Urs Eggli <address@hidden>.
        
        * src/roff/troff/node.h (node::~node): Move to...
        * src/roff/troff/node.cpp: Here.  Free `state' and `push_state'.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/groff/ChangeLog?cvsroot=groff&r1=1.1200&r2=1.1201
http://cvs.savannah.gnu.org/viewcvs/groff/src/roff/troff/node.cpp?cvsroot=groff&r1=1.28&r2=1.29
http://cvs.savannah.gnu.org/viewcvs/groff/src/roff/troff/node.h?cvsroot=groff&r1=1.33&r2=1.34

Patches:
Index: ChangeLog
===================================================================
RCS file: /cvsroot/groff/groff/ChangeLog,v
retrieving revision 1.1200
retrieving revision 1.1201
diff -u -b -r1.1200 -r1.1201
--- ChangeLog   1 Apr 2009 06:59:08 -0000       1.1200
+++ ChangeLog   10 Apr 2009 18:13:29 -0000      1.1201
@@ -1,3 +1,11 @@
+2009-04-10  Werner LEMBERG  <address@hidden>
+
+       Fix a memory leak in troff for -Thtml.
+       Reported by Urs Eggli <address@hidden>.
+
+       * src/roff/troff/node.h (node::~node): Move to...
+       * src/roff/troff/node.cpp: Here.  Free `state' and `push_state'.
+
 2009-04-01  Werner LEMBERG  <address@hidden>
 
        * tmac/doc.tmac: Call `ec' before mapping characters.

Index: src/roff/troff/node.cpp
===================================================================
RCS file: /cvsroot/groff/groff/src/roff/troff/node.cpp,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -b -r1.28 -r1.29
--- src/roff/troff/node.cpp     5 Jan 2009 20:11:12 -0000       1.28
+++ src/roff/troff/node.cpp     10 Apr 2009 18:13:30 -0000      1.29
@@ -1811,6 +1811,14 @@
 {
 }
 
+inline node::~node()
+{
+  if (state != 0)
+    delete state;
+  if (push_state != 0)
+    delete push_state;
+}
+
 /* glyphs, ligatures, kerns, discretionary breaks */
 
 class charinfo_node : public node {
@@ -4643,7 +4651,7 @@
   }
   else {
     hunits rem = x - w*i;
-    if (rem > H0)
+    if (rem > H0) {
       if (n->overlaps_horizontally()) {
        if (out->is_on())
          n->tprint(out);
@@ -4651,6 +4659,7 @@
       }
       else
        out->right(rem);
+    }
     while (--i >= 0)
       if (out->is_on())
        n->tprint(out);

Index: src/roff/troff/node.h
===================================================================
RCS file: /cvsroot/groff/groff/src/roff/troff/node.h,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -b -r1.33 -r1.34
--- src/roff/troff/node.h       5 Jan 2009 20:11:13 -0000       1.33
+++ src/roff/troff/node.h       10 Apr 2009 18:13:30 -0000      1.34
@@ -132,10 +132,6 @@
     state = 0;
 }
 
-inline node::~node()
-{
-}
-
 // 0 means it doesn't, 1 means it does, 2 means it's transparent
 
 int node_list_ends_sentence(node *);




reply via email to

[Prev in Thread] Current Thread [Next in Thread]