fix mem leak
This commit is contained in:
parent
151cd77b23
commit
c9cf84fccb
43
0001-coverity-173065-Resource-leak.patch
Normal file
43
0001-coverity-173065-Resource-leak.patch
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
From 47ed203d1f58157a8e8c5cce51bfa2094018f847 Mon Sep 17 00:00:00 2001
|
||||||
|
From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= <caolanm@redhat.com>
|
||||||
|
Date: Wed, 7 Dec 2016 16:24:58 +0000
|
||||||
|
Subject: [PATCH] coverity#173065 Resource leak
|
||||||
|
|
||||||
|
---
|
||||||
|
src/tools/hunspell.cxx | 14 +++++++-------
|
||||||
|
1 file changed, 7 insertions(+), 7 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/src/tools/hunspell.cxx b/src/tools/hunspell.cxx
|
||||||
|
index 6345cad..3a037b3 100644
|
||||||
|
--- a/src/tools/hunspell.cxx
|
||||||
|
+++ b/src/tools/hunspell.cxx
|
||||||
|
@@ -1131,19 +1131,19 @@ void dialogscreen(TextParser* parser,
|
||||||
|
|
||||||
|
// handle long lines and tabulators
|
||||||
|
std::string lines[MAXPREVLINE];
|
||||||
|
- std::string pPrevLine;
|
||||||
|
+ std::string prevLine;
|
||||||
|
for (int i = 0; i < MAXPREVLINE; i++) {
|
||||||
|
- pPrevLine = parser->get_prevline(i);
|
||||||
|
- expand_tab(lines[i], chenc(pPrevLine, io_enc, ui_enc));
|
||||||
|
+ prevLine = parser->get_prevline(i);
|
||||||
|
+ expand_tab(lines[i], chenc(prevLine, io_enc, ui_enc));
|
||||||
|
}
|
||||||
|
|
||||||
|
- pPrevLine = parser->get_prevline(0);
|
||||||
|
- std::string line = pPrevLine.substr(0, parser->get_tokenpos());
|
||||||
|
+ prevLine = parser->get_prevline(0);
|
||||||
|
+ std::string line = prevLine.substr(0, parser->get_tokenpos());
|
||||||
|
std::string line2;
|
||||||
|
int tokenbeg = expand_tab(line2, chenc(line, io_enc, ui_enc));
|
||||||
|
|
||||||
|
- pPrevLine = mystrdup(parser->get_prevline(0).c_str());
|
||||||
|
- line = pPrevLine.substr(0, parser->get_tokenpos() + token.size());
|
||||||
|
+ prevLine = parser->get_prevline(0);
|
||||||
|
+ line = prevLine.substr(0, parser->get_tokenpos() + token.size());
|
||||||
|
int tokenend = expand_tab(line2, chenc(line, io_enc, ui_enc));
|
||||||
|
|
||||||
|
int rowindex = (tokenend - 1) / x;
|
||||||
|
--
|
||||||
|
2.9.3
|
||||||
|
|
@ -19,6 +19,8 @@ BuildRequires: words
|
|||||||
%endif
|
%endif
|
||||||
Requires: hunspell-en-US
|
Requires: hunspell-en-US
|
||||||
|
|
||||||
|
Patch0: 0001-coverity-173065-Resource-leak.patch
|
||||||
|
|
||||||
%description
|
%description
|
||||||
Hunspell is a spell checker and morphological analyzer library and program
|
Hunspell is a spell checker and morphological analyzer library and program
|
||||||
designed for languages with rich morphology and complex word compounding or
|
designed for languages with rich morphology and complex word compounding or
|
||||||
@ -35,6 +37,7 @@ Includes and definitions for developing with hunspell
|
|||||||
|
|
||||||
%prep
|
%prep
|
||||||
%setup -q
|
%setup -q
|
||||||
|
%patch0 -p1 -b .cid173065
|
||||||
|
|
||||||
%build
|
%build
|
||||||
configureflags="--disable-rpath --disable-static --with-ui --with-readline"
|
configureflags="--disable-rpath --disable-static --with-ui --with-readline"
|
||||||
@ -122,7 +125,7 @@ rm -rf $RPM_BUILD_ROOT
|
|||||||
%{_mandir}/man5/hunspell.5.gz
|
%{_mandir}/man5/hunspell.5.gz
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
* Wed Dec 07 2016 Caolán McNamara <caolanm@redhat.com> - 1.5.4-1
|
* Tue Dec 13 2016 Caolán McNamara <caolanm@redhat.com> - 1.5.4-1
|
||||||
- latest release
|
- latest release
|
||||||
|
|
||||||
* Tue May 03 2016 Caolán McNamara <caolanm@redhat.com> - 1.4.1-1
|
* Tue May 03 2016 Caolán McNamara <caolanm@redhat.com> - 1.4.1-1
|
||||||
|
Loading…
Reference in New Issue
Block a user