At 10:35 AM 8/9/00 +0800, Yuqing Tang wrote: >if(!res) >{ > ldap_msgfree(res); > res = NULL; >} Try freeing res when true.