From 2ddd2b69e4df346deece27140f62d60fb353ebdd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20R=C3=BChsen?= Date: Mon, 6 Feb 2017 21:39:44 +0100 Subject: [PATCH] * src/iri.c (idn_encode): Fix memory leak --- contrib/check-hard | 5 +++-- src/iri.c | 2 ++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/contrib/check-hard b/contrib/check-hard index 00e40f2e..e96764f0 100755 --- a/contrib/check-hard +++ b/contrib/check-hard @@ -12,7 +12,8 @@ if [ $CORES -lt 1 ]; then CORES=1; fi echo "Running: make distclean" make distclean > /dev/null || true -CFLAGS="-std=c89 -pedantic -O0 -g -Wall -Wextra -Wstrict-prototypes -Wold-style-definition -Wwrite-strings -Wshadow -Wformat -Wformat-security -Wunreachable-code -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition" +#CFLAGS="-std=c89 -pedantic -O0 -g -Wall -Wextra -Wstrict-prototypes -Wold-style-definition -Wwrite-strings -Wshadow -Wformat -Wformat-security -Wunreachable-code -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition" +CFLAGS="-Wall -Wextra -O2 -g" CACHEFILE=$PWD/config_check.cache @@ -30,7 +31,7 @@ for CC in gcc clang; do # the compiler changed, so we have to remove the cache file here rm -f $CACHEFILE - for options in "" "--with-ssl=openssl"; do + for options in "" "--with-ssl=openssl" "--disable-iri"; do export DISTCHECK_CONFIGURE_FLAGS="-C --cache-file=$CACHEFILE $options" echo " ./configure $DISTCHECK_CONFIGURE_FLAGS" ./configure $DISTCHECK_CONFIGURE_FLAGS CFLAGS="$CFLAGS" > /dev/null diff --git a/src/iri.c b/src/iri.c index fbde5670..8be109e6 100644 --- a/src/iri.c +++ b/src/iri.c @@ -286,6 +286,8 @@ idn_encode (const struct iri *i, const char *host) xfree (lower); #endif + xfree (utf8_encoded); + return ret == IDN2_OK ? ascii_encoded : NULL; }