aboutsummaryrefslogtreecommitdiff
path: root/wcsmbs
diff options
context:
space:
mode:
authorFlorian Weimer <fweimer@redhat.com>2019-07-31 11:43:59 +0200
committerFlorian Weimer <fweimer@redhat.com>2019-07-31 11:43:59 +0200
commit0bfddfc9444ed6154da7e70bae6a1b4809b88c93 (patch)
tree3b6a738aeebc8f5b4cb0937c0995ce5c8d74e62a /wcsmbs
parentc86b8e7579ac2c4a1f1f70a56715580ed77b4a79 (diff)
downloadglibc-0bfddfc9444ed6154da7e70bae6a1b4809b88c93.zip
glibc-0bfddfc9444ed6154da7e70bae6a1b4809b88c93.tar.gz
glibc-0bfddfc9444ed6154da7e70bae6a1b4809b88c93.tar.bz2
iconv: Revert steps array reference counting changes
The changes introduce a memory leak for gconv steps arrays whose first element is an internal conversion, which has a fixed reference count which is not decremented. As a result, after the change in commit 50ce3eae5ba304650459d4441d7d246a7cefc26f, the steps array is never freed, resulting in an unbounded memory leak. This reverts commit 50ce3eae5ba304650459d4441d7d246a7cefc26f ("gconv: Check reference count in __gconv_release_cache [BZ #24677]") and commit 7e740ab2e7be7d83b75513aa406e0b10875f7f9c ("libio: Fix gconv-related memory leak [BZ #24583]"). It reintroduces bug 24583. (Bug 24677 was just a regression caused by the second commit.)
Diffstat (limited to 'wcsmbs')
-rw-r--r--wcsmbs/wcsmbsload.c10
-rw-r--r--wcsmbs/wcsmbsload.h1
2 files changed, 0 insertions, 11 deletions
diff --git a/wcsmbs/wcsmbsload.c b/wcsmbs/wcsmbsload.c
index 840d4ab..6648365 100644
--- a/wcsmbs/wcsmbsload.c
+++ b/wcsmbs/wcsmbsload.c
@@ -279,13 +279,3 @@ _nl_cleanup_ctype (struct __locale_data *locale)
free ((char *) data);
}
}
-
-/* Free the specified conversion functions (but not CONV itself). */
-void
-__wcsmbs_close_conv (struct gconv_fcts *conv)
-{
- if (conv->towc != &to_wc)
- __gconv_close_transform (conv->towc, conv->towc_nsteps);
- if (conv->tomb != &to_mb)
- __gconv_close_transform (conv->tomb, conv->tomb_nsteps);
-}
diff --git a/wcsmbs/wcsmbsload.h b/wcsmbs/wcsmbsload.h
index c2fffbd..6ccad4b 100644
--- a/wcsmbs/wcsmbsload.h
+++ b/wcsmbs/wcsmbsload.h
@@ -51,7 +51,6 @@ extern int __wcsmbs_named_conv (struct gconv_fcts *copy, const char *name)
/* Function used for the `private.cleanup' hook. */
extern void _nl_cleanup_ctype (struct __locale_data *) attribute_hidden;
-extern void __wcsmbs_close_conv (struct gconv_fcts *conv) attribute_hidden;
#include <iconv/gconv_int.h>