X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;ds=sidebyside;f=libraries%2Flibldap%2Fwhoami.c;h=9fa7ceb4053c3d83ef9f14e236c7b442dba44426;hb=fb5ba5f09c604aa2c9cdf7076141da60fbb925b3;hp=ec96523d32158fc7d6fb25f1687423706c9ac9fc;hpb=8c8ea049cba497d0dbccefcda01af4dc5c7138f7;p=openldap diff --git a/libraries/libldap/whoami.c b/libraries/libldap/whoami.c index ec96523d32..9fa7ceb405 100644 --- a/libraries/libldap/whoami.c +++ b/libraries/libldap/whoami.c @@ -1,7 +1,7 @@ /* $OpenLDAP$ */ /* This work is part of OpenLDAP Software . * - * Copyright 1998-2006 The OpenLDAP Foundation. + * Copyright 1998-2011 The OpenLDAP Foundation. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -88,7 +88,7 @@ ldap_whoami_s( rc = ldap_whoami( ld, sctrls, cctrls, &msgid ); if ( rc != LDAP_SUCCESS ) return rc; - if ( ldap_result( ld, msgid, LDAP_MSG_ALL, (struct timeval *) NULL, &res ) == -1 ) { + if ( ldap_result( ld, msgid, LDAP_MSG_ALL, (struct timeval *) NULL, &res ) == -1 || !res ) { return ld->ld_errno; }