external/liblangtag: Fix memory leak

Change-Id: I7d58c1aad5ec21f14569caedbada56cc31a5ff99
This commit is contained in:
Stephan Bergmann 2014-05-26 14:25:26 +02:00
parent d8f958a201
commit f5d90767d1
2 changed files with 13 additions and 0 deletions

View File

@ -15,6 +15,8 @@ $(eval $(call gb_UnpackedTarball_set_pre_action,langtag,\
$(GNUTAR) -x -j -f $(gb_UnpackedTarget_TARFILE_LOCATION)/$(LANGTAGREG_TARBALL) \
))
# external/liblangtag/liblangtag-leak.patch.0 upstream:
# <https://bitbucket.org/tagoh/liblangtag/pull-request/8/fix-memory-leak/diff>
$(eval $(call gb_UnpackedTarball_add_patches,langtag,\
external/liblangtag/liblangtag-0.5.1-msvc-warning.patch \
external/liblangtag/liblangtag-0.5.1-vsnprintf.patch \
@ -27,6 +29,7 @@ $(eval $(call gb_UnpackedTarball_add_patches,langtag,\
external/liblangtag/liblangtag-0.5.1-windows-do-not-prepend-dir-separator.patch \
external/liblangtag/liblangtag-0.5.1-unistd.patch \
external/liblangtag/liblangtag-0.5.1-include-last-record-in-language-subtag-registry.patch \
external/liblangtag/liblangtag-leak.patch.0 \
))
ifeq ($(OS),WNT)

View File

@ -0,0 +1,10 @@
--- liblangtag/lt-tag.c
+++ liblangtag/lt-tag.c
@@ -1408,6 +1408,7 @@
lt_variant_ref(lt_list_value(l)),
(lt_destroy_func_t)lt_variant_unref);
}
+ lt_mem_add_ref(&retval->parent, retval->variants, lt_list_free);
}
if (tag->extension) {
lt_tag_set_extension(retval, lt_extension_copy(tag->extension));