1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-11-24 00:45:52 +00:00

Plug memory leak in librecode.

Bump PORTREVISION.

PR:		89934
Submitted by:	Sergey Prikhodko <sergey@network-asp.biz>
This commit is contained in:
Dmitry Sivachenko 2005-12-08 11:18:11 +00:00
parent 0da2455aa9
commit 129f54943e
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=150652
3 changed files with 52 additions and 1 deletions

View File

@ -7,7 +7,7 @@
PORTNAME= recode PORTNAME= recode
PORTVERSION= 3.6 PORTVERSION= 3.6
PORTREVISION= 4 PORTREVISION= 5
CATEGORIES= converters CATEGORIES= converters
MASTER_SITES= ${MASTER_SITE_GNU} MASTER_SITES= ${MASTER_SITE_GNU}
MASTER_SITE_SUBDIR= recode MASTER_SITE_SUBDIR= recode

View File

@ -0,0 +1,33 @@
--- src/names.c.orig Wed Dec 6 21:41:29 2000
+++ src/names.c Fri Dec 2 16:12:26 2005
@@ -101,6 +101,21 @@
return strcmp (first->name, second->name) == 0;
}
+static void
+alias_freer (void *param)
+{
+ RECODE_ALIAS alias = param;
+ struct recode_surface_list *next = alias->implied_surfaces;
+ struct recode_surface_list *p;
+ while (next)
+ {
+ p = next->next;
+ free(next);
+ next = p;
+ }
+ free(alias);
+}
+
bool
prepare_for_aliases (RECODE_OUTER outer)
{
@@ -108,7 +123,7 @@
outer->number_of_symbols = 0;
outer->alias_table
- = hash_initialize (800, NULL, alias_hasher, alias_comparator, free);
+ = hash_initialize (800, NULL, alias_hasher, alias_comparator, alias_freer);
if (!outer->alias_table)
return false;

View File

@ -0,0 +1,18 @@
--- src/outer.c.orig Wed Aug 30 23:16:14 2000
+++ src/outer.c Fri Dec 2 16:12:26 2005
@@ -617,7 +617,14 @@
if (outer->alias_table)
hash_free (outer->alias_table);
if (outer->argmatch_charset_array)
- free (outer->argmatch_charset_array);
+ {
+ char **cursor;
+ for (cursor = outer->argmatch_charset_array; *cursor; cursor++)
+ free (*cursor);
+ for (cursor = outer->argmatch_surface_array; *cursor; cursor++)
+ free (*cursor);
+ free (outer->argmatch_charset_array);
+ }
if (outer->one_to_same)
free ((void *) outer->one_to_same);
free (outer);