From: Fabian Maurer dark.shadow4@web.de
--- dlls/wldap32/misc.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/dlls/wldap32/misc.c b/dlls/wldap32/misc.c index edf1f196353..9db98cc9e46 100644 --- a/dlls/wldap32/misc.c +++ b/dlls/wldap32/misc.c @@ -413,10 +413,15 @@ ULONG CDECL WLDAP32_ldap_result( LDAP *ld, ULONG msgid, ULONG all, struct l_time
ret = ldap_result( CTX(ld), msgid, all, timeout ? &timeval : NULL, &msgU ); } - if (msgU && (msg = calloc( 1, sizeof(*msg) ))) + if (msgU) { - MSG(msg) = msgU; - *res = msg; + if ((msg = calloc( 1, sizeof(*msg) ))) + { + MSG(msg) = msgU; + *res = msg; + } + else + free( msgU ); }
return ret;