Commit 0408d3a8 authored by Fabian Maurer's avatar Fabian Maurer Committed by Alexandre Julliard

wldap32: Free resource in error case and return error code (Coverity).

parent 4a8b12a1
......@@ -413,12 +413,18 @@ 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)
return ret;
if (!(msg = calloc( 1, sizeof(*msg) )))
{
MSG(msg) = msgU;
*res = msg;
free( msgU );
return WLDAP32_LDAP_NO_MEMORY;
}
MSG(msg) = msgU;
*res = msg;
return ret;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment