talons

Fork of Claws Mail https://www.claws-mail
Log | Files | Refs | README | LICENSE

commit 72a9c0b46adc467c6ceacc608bceff52c19950dd
parent 6044d9dcb1b996b1ba269174441eebf51a96439b
Author: Andrej Kacian <ticho@claws-mail.org>
Date:   Sat, 20 Jun 2015 22:38:53 +0200

Do not free LDAP error string on Windows.

Fixes bug #2816 - LDAP addressbook search crashes Claws Mail.

Diffstat:
Msrc/ldaputil.c | 7+++++++
1 file changed, 7 insertions(+), 0 deletions(-)

diff --git a/src/ldaputil.c b/src/ldaputil.c @@ -324,7 +324,14 @@ const gchar *ldaputil_get_error(LDAP *ld) strncpy2(error, ld_error, sizeof(error)); else strncpy2(error, _("Unknown error"), sizeof(error)); +#ifndef G_OS_WIN32 + /* From https://msdn.microsoft.com/en-us/library/aa366594%28v=vs.85%29.aspx + * "LDAP_OPT_ERROR_STRING returns a pointer to an internal static + * string table, and ldap_memfree should not be called when using + * this session option." + */ ldap_memfree(ld_error); +#endif return error; }