* src/iri.c (idn_encode): Fix memory leak

This commit is contained in:
Tim Rühsen 2017-02-06 21:39:44 +01:00
parent 990f3d67d3
commit 2ddd2b69e4
2 changed files with 5 additions and 2 deletions

View File

@ -12,7 +12,8 @@ if [ $CORES -lt 1 ]; then CORES=1; fi
echo "Running: make distclean" echo "Running: make distclean"
make distclean > /dev/null || true 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 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 # the compiler changed, so we have to remove the cache file here
rm -f $CACHEFILE 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" export DISTCHECK_CONFIGURE_FLAGS="-C --cache-file=$CACHEFILE $options"
echo " ./configure $DISTCHECK_CONFIGURE_FLAGS" echo " ./configure $DISTCHECK_CONFIGURE_FLAGS"
./configure $DISTCHECK_CONFIGURE_FLAGS CFLAGS="$CFLAGS" > /dev/null ./configure $DISTCHECK_CONFIGURE_FLAGS CFLAGS="$CFLAGS" > /dev/null

View File

@ -286,6 +286,8 @@ idn_encode (const struct iri *i, const char *host)
xfree (lower); xfree (lower);
#endif #endif
xfree (utf8_encoded);
return ret == IDN2_OK ? ascii_encoded : NULL; return ret == IDN2_OK ? ascii_encoded : NULL;
} }