[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: ldap_search_st() problem



At 10:35 AM 1/14/99 -0600, Ashely Hornbeck wrote:
>struct timeval tv;
>ldap_search_st(ld, searchbase, LDAP_SCOPE_ONELEVEL, filter, 0, &tv,
>&result);
>free(tv);

You cannot free() tv.  It was allocated on the stack.

>Code sample 2:
>struct timeval *tv;
>tv = (struct timeval*)malloc(sizeof(struct timeval));
>tv->sec = 10;
>tv->usec = 0;
>
>ldap_search_st(ld, searchbase, LDAP_SCOPE_ONELEVEL, filter, 0, &tv,
>&result);

You passed a struct timeval** instead of struct timeval*.
Remove the '&'.


Kurt