[PATCH 2/8] wldap32: Handle NULL return in ldap_get_values_lenW.

Dmitry Timoshkov dmitry at baikal.ru
Mon Mar 23 08:14:22 CDT 2020


Signed-off-by: Dmitry Timoshkov <dmitry at baikal.ru>
---
 dlls/wldap32/value.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/dlls/wldap32/value.c b/dlls/wldap32/value.c
index bcfa9a2f6b..4e1701c926 100644
--- a/dlls/wldap32/value.c
+++ b/dlls/wldap32/value.c
@@ -229,12 +229,14 @@ PWCHAR * CDECL ldap_get_valuesW( WLDAP32_LDAP *ld, WLDAP32_LDAPMessage *entry, P
     if (!attrU) return NULL;
 
     bv = ldap_get_values_len( ld, entry, attrU );
+    if (bv)
+    {
+        retU = bv2str_array( bv );
+        ret = strarrayUtoW( retU );
 
-    retU = bv2str_array( bv );
-    ret = strarrayUtoW( retU );
-
-    ldap_value_free_len( bv );
-    strarrayfreeU( retU );
+        ldap_value_free_len( bv );
+        strarrayfreeU( retU );
+    }
     strfreeU( attrU );
 
 #endif
-- 
2.25.1




More information about the wine-devel mailing list