1
0
mirror of https://github.com/moparisthebest/wget synced 2024-07-03 16:38:41 -04:00

Fix potential memory leak and libpsl configure

This commit is contained in:
Darshit Shah 2014-07-21 13:25:54 +05:30
parent e43ae39dff
commit a44841cbe2
4 changed files with 22 additions and 8 deletions

View File

@ -1,3 +1,7 @@
2014-07-21 Darshit Shah <darnir@gmail.com>
* configure.ac: Fix check for Libpsl
2014-06-28 Giuseppe Scrivano <gscrivan@redhat.com> 2014-06-28 Giuseppe Scrivano <gscrivan@redhat.com>
* cfg.mk (local-checks-to-skip): Remove some checks. * cfg.mk (local-checks-to-skip): Remove some checks.

View File

@ -63,7 +63,14 @@ dnl
AC_ARG_WITH(libpsl, AC_ARG_WITH(libpsl,
AS_HELP_STRING([--without-libpsl], AS_HELP_STRING([--without-libpsl],
[disable support for libpsl cookie checking.])) [disable support for libpsl cookie checking.]),
[],
[AC_SEARCH_LIBS(psl_builtin, psl,
[AC_DEFINE([WITH_LIBPSL], [1], [PSL Support Enabled])],
[AC_MSG_WARN(*** libpsl not found. Falling back to tail matching)])
])
AS_IF([test x$ac_cv_search_psl_builtin != "x-psl"], [ENABLE_PSL=no],
[ENABLE_PSL=yes])
AC_ARG_WITH(ssl, AC_ARG_WITH(ssl,
[[ --without-ssl disable SSL autodetection [[ --without-ssl disable SSL autodetection
@ -238,11 +245,6 @@ dnl
dnl Checks for libraries. dnl Checks for libraries.
dnl dnl
AS_IF([test x"$with_libpsl" != xno], [
with_libpsl=yes
AC_CHECK_LIB([psl], [psl_builtin])
])
AS_IF([test x"$with_zlib" != xno], [ AS_IF([test x"$with_zlib" != xno], [
with_zlib=yes with_zlib=yes
AC_CHECK_LIB(z, compress) AC_CHECK_LIB(z, compress)
@ -593,7 +595,7 @@ AC_MSG_NOTICE([Summary of build options:
Libs: $LIBS Libs: $LIBS
SSL: $with_ssl SSL: $with_ssl
Zlib: $with_zlib Zlib: $with_zlib
PSL: $with_libpsl PSL: $ENABLE_PSL
Digest: $ENABLE_DIGEST Digest: $ENABLE_DIGEST
NTLM: $ENABLE_NTLM NTLM: $ENABLE_NTLM
OPIE: $ENABLE_OPIE OPIE: $ENABLE_OPIE

View File

@ -1,3 +1,8 @@
2014-07-21 Darshit Shah <darnir@gmail.com>
* cookies.c (check_domain_match): Fix a potential memory leak when checking
cookie domain names
2014-07-07 Tomas Hozza <thozza@redhat.com> 2014-07-07 Tomas Hozza <thozza@redhat.com>
* iri.c (locale_to_utf8): Fix checking of iconv_open return code. * iri.c (locale_to_utf8): Fix checking of iconv_open return code.

View File

@ -546,9 +546,12 @@ check_domain_match (const char *cookie_domain, const char *host)
xfree (cookie_domain_lower); xfree (cookie_domain_lower);
xfree (host_lower); xfree (host_lower);
return true ? (is_acceptable == 1) : false; return is_acceptable == 1;
no_psl: no_psl:
/* Cleanup the PSL pointers first */
xfree (cookie_domain_lower);
xfree (host_lower);
#endif #endif
/* For efficiency make some elementary checks first */ /* For efficiency make some elementary checks first */