Fix memory leak when using -re option

This commit is contained in:
Vitezslav Crhonek 2013-10-02 14:22:28 +02:00
parent d0adcdc223
commit ca57771ac4
2 changed files with 21 additions and 1 deletions

View File

@ -0,0 +1,14 @@
diff -up expect5.45/expect.c.orig expect5.45/expect.c
--- expect5.45/expect.c.orig 2013-10-02 13:16:31.462430482 +0200
+++ expect5.45/expect.c 2013-10-02 13:17:18.420599495 +0200
@@ -185,9 +185,9 @@ free_ecase(
{
if (ec->i_list->duration == EXP_PERMANENT) {
if (ec->pat) { Tcl_DecrRefCount(ec->pat); }
- if (ec->gate) { Tcl_DecrRefCount(ec->gate); }
if (ec->body) { Tcl_DecrRefCount(ec->body); }
}
+ if (ec->gate) { Tcl_DecrRefCount(ec->gate); }
if (free_ilist) {
ec->i_list->ecount--;

View File

@ -5,7 +5,7 @@
Summary: A program-script interaction and testing utility Summary: A program-script interaction and testing utility
Name: expect Name: expect
Version: %{majorver} Version: %{majorver}
Release: 11%{?dist} Release: 12%{?dist}
License: Public Domain License: Public Domain
Group: Development/Languages Group: Development/Languages
# URL: probably more useful is http://sourceforge.net/projects/expect/ # URL: probably more useful is http://sourceforge.net/projects/expect/
@ -21,6 +21,8 @@ Patch1: expect-5.43.0-pkgpath.patch
Patch2: expect-5.45-man-page.patch Patch2: expect-5.45-man-page.patch
# Patch3: fixes segmentation fault during matching characters # Patch3: fixes segmentation fault during matching characters
Patch3: expect-5.45-match-gt-numchars-segfault.patch Patch3: expect-5.45-match-gt-numchars-segfault.patch
# Patch4: fixes memory leak when using -re, http://sourceforge.net/p/expect/patches/13/
Patch4: expect-5.45-re-memleak.patch
# examples patches # examples patches
# Patch100: changes random function # Patch100: changes random function
Patch100: expect-5.32.2-random.patch Patch100: expect-5.32.2-random.patch
@ -78,6 +80,7 @@ of expectk.
%patch1 -p1 -b .pkgpath %patch1 -p1 -b .pkgpath
%patch2 -p1 -b .man-page %patch2 -p1 -b .man-page
%patch3 -p1 -b .match-gt-numchars-segfault %patch3 -p1 -b .match-gt-numchars-segfault
%patch4 -p1 -b .re-memleak
# examples fixes # examples fixes
%patch100 -p1 -b .random %patch100 -p1 -b .random
%patch101 -p1 -b .mkpasswd-dash %patch101 -p1 -b .mkpasswd-dash
@ -167,6 +170,9 @@ rm -rf "$RPM_BUILD_ROOT"
%{_mandir}/man1/tknewsbiff.1* %{_mandir}/man1/tknewsbiff.1*
%changelog %changelog
* Wed Oct 02 2013 Vitezslav Crhonek <vcrhonek@redhat.com> - 5.45-12
- Fix memory leak when using -re option
* Tue Aug 27 2013 Vitezslav Crhonek <vcrhonek@redhat.com> - 5.45-11 * Tue Aug 27 2013 Vitezslav Crhonek <vcrhonek@redhat.com> - 5.45-11
- Fix inaccuracy in mkpasswd man page - Fix inaccuracy in mkpasswd man page
Resolves: #963889 Resolves: #963889