mirror of
https://git.FreeBSD.org/ports.git
synced 2024-11-23 00:43:28 +00:00
Plug memory leak in librecode.
Bump PORTREVISION. PR: 89934 Submitted by: Sergey Prikhodko <sergey@network-asp.biz>
This commit is contained in:
parent
0da2455aa9
commit
129f54943e
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=150652
@ -7,7 +7,7 @@
|
||||
|
||||
PORTNAME= recode
|
||||
PORTVERSION= 3.6
|
||||
PORTREVISION= 4
|
||||
PORTREVISION= 5
|
||||
CATEGORIES= converters
|
||||
MASTER_SITES= ${MASTER_SITE_GNU}
|
||||
MASTER_SITE_SUBDIR= recode
|
||||
|
33
converters/recode/files/patch-src::names.c
Normal file
33
converters/recode/files/patch-src::names.c
Normal 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;
|
||||
|
18
converters/recode/files/patch-src::outer.c
Normal file
18
converters/recode/files/patch-src::outer.c
Normal 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);
|
Loading…
Reference in New Issue
Block a user