backport to fix a couple of small memory leaks

This commit is contained in:
Than Ngo 2015-12-04 16:30:12 +01:00
parent 5e50ad484c
commit 3b835434d3
2 changed files with 64 additions and 1 deletions

View File

@ -0,0 +1,58 @@
commit 85ddfc814f33943199928447b4627d05b0920b99
Author: Dimitri van Heesch <dimitri@stack.nl>
Date: Sat Nov 14 13:50:56 2015 +0100
Fixed a couple of small memory leaks
diff --git a/src/classdef.cpp b/src/classdef.cpp
index fa555ac..88f9a70 100644
--- a/src/classdef.cpp
+++ b/src/classdef.cpp
@@ -2603,7 +2603,7 @@ void ClassDef::setTypeConstraints(ArgumentList *al)
void ClassDef::setTemplateArguments(ArgumentList *al)
{
if (al==0) return;
- if (!m_impl->tempArgs) delete m_impl->tempArgs; // delete old list if needed
+ if (m_impl->tempArgs) delete m_impl->tempArgs; // delete old list if needed
//printf("setting template args '%s' for '%s'\n",tempArgListToString(al,getLanguage()).data(),name().data());
m_impl->tempArgs=new ArgumentList;
ArgumentListIterator ali(*al);
diff --git a/src/pre.l b/src/pre.l
index 86f9ebb..18f3b1d 100644
--- a/src/pre.l
+++ b/src/pre.l
@@ -1659,6 +1659,7 @@ static void endCondSection()
{
CondCtx *ctx = g_condStack.pop();
g_skip=ctx->skip;
+ delete ctx;
}
//printf("endCondSection: skip=%d stack=%d\n",g_skip,g_condStack.count());
}
@@ -1667,7 +1668,7 @@ static void forceEndCondSection()
{
while (!g_condStack.isEmpty())
{
- g_condStack.pop();
+ delete g_condStack.pop();
}
g_skip=FALSE;
}
@@ -3010,8 +3011,8 @@ void preprocessFile(const char *fileName,BufStr &input,BufStr &output)
g_includeStack.clear();
g_expandedDict->setAutoDelete(FALSE);
g_expandedDict->clear();
- g_condStack.clear();
g_condStack.setAutoDelete(TRUE);
+ g_condStack.clear();
//g_fileDefineDict->clear();
setFileName(fileName);
@@ -3161,6 +3162,7 @@ void preprocessFile(const char *fileName,BufStr &input,BufStr &output)
if (ctx->sectionId!=" ") sectionInfo.sprintf(" with label %s ",ctx->sectionId.data());
warn(fileName,ctx->lineNr,"Conditional section%sdoes not have "
"a corresponding \\endcond command within this file.",sectionInfo.data());
+ delete ctx;
}
// make sure we don't extend a \cond with missing \endcond over multiple files (see bug 624829)
forceEndCondSection();

View File

@ -2,7 +2,7 @@ Summary: A documentation system for C/C++
Name: doxygen
Epoch: 1
Version: 1.8.10
Release: 6%{?dist}
Release: 7%{?dist}
# No version is specified.
License: GPL+
@ -22,6 +22,7 @@ Patch104: doxygen-1.8.10-fixspace.patch
Patch105: doxygen-1.8.10-xml.patch
Patch106: doxygen-1.8.10-latex.patch
Patch107: doxygen-1.8.10-timestamp-latex.patch
Patch108: doxygen-1.8.10-memory-leaks.patch
BuildRequires: perl
BuildRequires: tex(dvips)
@ -81,6 +82,7 @@ Requires: texlive-epstopdf-bin
%patch105 -p1 -b .xml
%patch106 -p1 -b .latex
%patch107 -p1 -b .latex-timestamps
%patch108 -p1 -b .leaks
# convert into utf-8
iconv --from=ISO-8859-1 --to=UTF-8 LANGUAGE.HOWTO > LANGUAGE.HOWTO.new
@ -136,6 +138,9 @@ desktop-file-install \
%changelog
* Fri Dec 04 2015 Than Ngo <than@redhat.com> - 1:1.8.10-7
- backport to fix a couple of small memory leaks
* Tue Nov 10 2015 Than Ngo <than@redhat.com> - 1:1.8.10-6
- backport patches to fix follow issues:
angle brackets (< and >) not escaped in HTML formula alt text