|
|
# --- ROCK-COPYRIGHT-NOTE-BEGIN --- # # This copyright note is auto-generated by ./scripts/Create-CopyPatch. # Please add additional copyright information _after_ the line containing # the ROCK-COPYRIGHT-NOTE-END tag. Otherwise it might get removed by # the ./scripts/Create-CopyPatch script. Do not edit this copyright text! # # ROCK Linux: rock-src/package/tsa/slrn/mem_leak.patch # ROCK Linux is Copyright (C) 1998 - 2003 Clifford Wolf # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. A copy of the GNU General Public # License can be found at Documentation/COPYING. # # Many people helped and are helping developing ROCK Linux. Please # have a look at http://www.rocklinux.org/ and the Documentation/TEAM # file for details. # # --- ROCK-COPYRIGHT-NOTE-END ---
--- ./src/score.c Wed Mar 13 13:52:00 2002
+++ ./src/score.c Fri Apr 5 23:20:20 2002
@@ -550,6 +550,19 @@
char *Slrn_Scorefile_Open = NULL; +static void free_srt (Score_Regexp_Type *srt)
+{
+ while (srt != NULL)
+ {
+ Score_Regexp_Type *srt_next = srt->next;
+ if ((srt->header_type == SCORE_SUB_AND) ||
+ (srt->header_type == SCORE_SUB_OR))
+ free_srt (srt->search.srt);
+ SLFREE (srt);
+ srt = srt_next;
+ }
+}
+
static void free_group_chain (void) { Score_Regexp_Type *srt; @@ -558,13 +571,11 @@
{ Score_Type *next = Score_Root->next; srt = &Score_Root->regexp_list; - srt = srt->next; /* first not malloced */
- while (srt != NULL)
- {
- Score_Regexp_Type *srt_next = srt->next;
- SLFREE (srt);
- srt = srt_next;
- }
+ /* first not malloced; free subscores only: */
+ if ((srt->header_type == SCORE_SUB_AND) ||
+ (srt->header_type == SCORE_SUB_OR))
+ free_srt (srt->search.srt);
+ free_srt (srt->next);
SLFREE (Score_Root); Score_Root = next; } @@ -837,6 +848,21 @@
} +static void free_psrt (PScore_Regexp_Type *r)
+{
+ while (r != NULL)
+ {
+ PScore_Regexp_Type *rnext = r->next;
+
+ if ((r->header_type == SCORE_SUB_AND) ||
+ (r->header_type == SCORE_SUB_OR))
+ free_psrt (r->ireg.psrt);
+ else if ((r->flags & USE_INTEGER) == 0)
+ slrn_free ((char *) r->ireg.regexp_str);
+ SLFREE (r);
+ r = rnext;
+ }
+}
static void free_group_scores (void) { @@ -857,30 +883,14 @@
while (pst != NULL) { PScore_Type *pnext = pst->next; - PScore_Regexp_Type *r = pst->pregexp_list;
- while (r != NULL)
- {
- PScore_Regexp_Type *rnext = r->next;
-
- if ((r->flags & USE_INTEGER) == 0)
- slrn_free ((char *) r->ireg.regexp_str);
- SLFREE (r);
- r = rnext;
- }
+ free_psrt (pst->pregexp_list);
slrn_free ((char *) pst->description); SLFREE (pst); +
pst = pnext; } - while (Scorefile_Names != NULL)
- {
- Scorefile_Name_Type *next = Scorefile_Names->next;
- slrn_free ((char *) Scorefile_Names->filename);
- slrn_free ((char *) Scorefile_Names);
- Scorefile_Names = next;
- }
-
SLFREE (Group_Score_Root); Group_Score_Root = gnext; } @@ -1177,7 +1187,7 @@
ret = add_group_regexp (psrt, lp + 5, lp, SCORE_BYTES, not_flag); else if (!slrn_case_strncmp (lp, (unsigned char *)"Message-Id:", 11)) ret = add_group_regexp (psrt, lp + 10, lp, SCORE_MESSAGE_ID, not_flag); - else if (!slrn_case_strncmp (lp, (unsigned char *)"{:", 1))
+ else if (!slrn_case_strncmp (lp, (unsigned char *)"{:", 2))
{ if (lp[2] ==':') { @@ -1191,6 +1201,7 @@
} else if (!slrn_case_strncmp (lp, (unsigned char *)"}", 1)) { + SLFREE (psrt);
if (sub_psrt != NULL) return 0; else @@ -1205,6 +1216,7 @@
while (*lpp && (*lpp != ':')) lpp++; if (*lpp != ':') { + SLFREE (psrt);
score_error (_("Missing COLON."), line, *linenum, file); return -1; } @@ -1298,6 +1310,13 @@
free_group_scores (); } free_group_chain (); + while (Scorefile_Names != NULL)
+ {
+ Scorefile_Name_Type *next = Scorefile_Names->next;
+ slrn_free ((char *) Scorefile_Names->filename);
+ slrn_free ((char *) Scorefile_Names);
+ Scorefile_Names = next;
+ }
sc.today = get_today (); sc.score = 0;
|