mirror of the now-defunct rocklinux.org
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

157 lines
4.3 KiB

  1. # --- ROCK-COPYRIGHT-NOTE-BEGIN ---
  2. #
  3. # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
  4. # Please add additional copyright information _after_ the line containing
  5. # the ROCK-COPYRIGHT-NOTE-END tag. Otherwise it might get removed by
  6. # the ./scripts/Create-CopyPatch script. Do not edit this copyright text!
  7. #
  8. # ROCK Linux: rock-src/package/tsa/slrn/mem_leak.patch
  9. # ROCK Linux is Copyright (C) 1998 - 2003 Clifford Wolf
  10. #
  11. # This program is free software; you can redistribute it and/or modify
  12. # it under the terms of the GNU General Public License as published by
  13. # the Free Software Foundation; either version 2 of the License, or
  14. # (at your option) any later version. A copy of the GNU General Public
  15. # License can be found at Documentation/COPYING.
  16. #
  17. # Many people helped and are helping developing ROCK Linux. Please
  18. # have a look at http://www.rocklinux.org/ and the Documentation/TEAM
  19. # file for details.
  20. #
  21. # --- ROCK-COPYRIGHT-NOTE-END ---
  22. --- ./src/score.c Wed Mar 13 13:52:00 2002
  23. +++ ./src/score.c Fri Apr 5 23:20:20 2002
  24. @@ -550,6 +550,19 @@
  25. char *Slrn_Scorefile_Open = NULL;
  26. +static void free_srt (Score_Regexp_Type *srt)
  27. +{
  28. + while (srt != NULL)
  29. + {
  30. + Score_Regexp_Type *srt_next = srt->next;
  31. + if ((srt->header_type == SCORE_SUB_AND) ||
  32. + (srt->header_type == SCORE_SUB_OR))
  33. + free_srt (srt->search.srt);
  34. + SLFREE (srt);
  35. + srt = srt_next;
  36. + }
  37. +}
  38. +
  39. static void free_group_chain (void)
  40. {
  41. Score_Regexp_Type *srt;
  42. @@ -558,13 +571,11 @@
  43. {
  44. Score_Type *next = Score_Root->next;
  45. srt = &Score_Root->regexp_list;
  46. - srt = srt->next; /* first not malloced */
  47. - while (srt != NULL)
  48. - {
  49. - Score_Regexp_Type *srt_next = srt->next;
  50. - SLFREE (srt);
  51. - srt = srt_next;
  52. - }
  53. + /* first not malloced; free subscores only: */
  54. + if ((srt->header_type == SCORE_SUB_AND) ||
  55. + (srt->header_type == SCORE_SUB_OR))
  56. + free_srt (srt->search.srt);
  57. + free_srt (srt->next);
  58. SLFREE (Score_Root);
  59. Score_Root = next;
  60. }
  61. @@ -837,6 +848,21 @@
  62. }
  63. +static void free_psrt (PScore_Regexp_Type *r)
  64. +{
  65. + while (r != NULL)
  66. + {
  67. + PScore_Regexp_Type *rnext = r->next;
  68. +
  69. + if ((r->header_type == SCORE_SUB_AND) ||
  70. + (r->header_type == SCORE_SUB_OR))
  71. + free_psrt (r->ireg.psrt);
  72. + else if ((r->flags & USE_INTEGER) == 0)
  73. + slrn_free ((char *) r->ireg.regexp_str);
  74. + SLFREE (r);
  75. + r = rnext;
  76. + }
  77. +}
  78. static void free_group_scores (void)
  79. {
  80. @@ -857,30 +883,14 @@
  81. while (pst != NULL)
  82. {
  83. PScore_Type *pnext = pst->next;
  84. - PScore_Regexp_Type *r = pst->pregexp_list;
  85. - while (r != NULL)
  86. - {
  87. - PScore_Regexp_Type *rnext = r->next;
  88. -
  89. - if ((r->flags & USE_INTEGER) == 0)
  90. - slrn_free ((char *) r->ireg.regexp_str);
  91. - SLFREE (r);
  92. - r = rnext;
  93. - }
  94. + free_psrt (pst->pregexp_list);
  95. slrn_free ((char *) pst->description);
  96. SLFREE (pst);
  97. +
  98. pst = pnext;
  99. }
  100. - while (Scorefile_Names != NULL)
  101. - {
  102. - Scorefile_Name_Type *next = Scorefile_Names->next;
  103. - slrn_free ((char *) Scorefile_Names->filename);
  104. - slrn_free ((char *) Scorefile_Names);
  105. - Scorefile_Names = next;
  106. - }
  107. -
  108. SLFREE (Group_Score_Root);
  109. Group_Score_Root = gnext;
  110. }
  111. @@ -1177,7 +1187,7 @@
  112. ret = add_group_regexp (psrt, lp + 5, lp, SCORE_BYTES, not_flag);
  113. else if (!slrn_case_strncmp (lp, (unsigned char *)"Message-Id:", 11))
  114. ret = add_group_regexp (psrt, lp + 10, lp, SCORE_MESSAGE_ID, not_flag);
  115. - else if (!slrn_case_strncmp (lp, (unsigned char *)"{:", 1))
  116. + else if (!slrn_case_strncmp (lp, (unsigned char *)"{:", 2))
  117. {
  118. if (lp[2] ==':')
  119. {
  120. @@ -1191,6 +1201,7 @@
  121. }
  122. else if (!slrn_case_strncmp (lp, (unsigned char *)"}", 1))
  123. {
  124. + SLFREE (psrt);
  125. if (sub_psrt != NULL)
  126. return 0;
  127. else
  128. @@ -1205,6 +1216,7 @@
  129. while (*lpp && (*lpp != ':')) lpp++;
  130. if (*lpp != ':')
  131. {
  132. + SLFREE (psrt);
  133. score_error (_("Missing COLON."), line, *linenum, file);
  134. return -1;
  135. }
  136. @@ -1298,6 +1310,13 @@
  137. free_group_scores ();
  138. }
  139. free_group_chain ();
  140. + while (Scorefile_Names != NULL)
  141. + {
  142. + Scorefile_Name_Type *next = Scorefile_Names->next;
  143. + slrn_free ((char *) Scorefile_Names->filename);
  144. + slrn_free ((char *) Scorefile_Names);
  145. + Scorefile_Names = next;
  146. + }
  147. sc.today = get_today ();
  148. sc.score = 0;