diff --git a/lib/libc/net/getservent.c b/lib/libc/net/getservent.c index 26c2e28ed7f8..24c73d7e15ea 100644 --- a/lib/libc/net/getservent.c +++ b/lib/libc/net/getservent.c @@ -66,10 +66,12 @@ servent_data_clear(struct servent_data *sed) fclose(sed->fp); sed->fp = NULL; } +#ifdef YP if (sed->key) { free(sed->key); sed->key = NULL; } +#endif } static void @@ -243,8 +245,10 @@ endservent_r(struct servent_data *sed) { servent_data_clear(sed); sed->stayopen = 0; +#ifdef YP sed->stepping_yp = 0; sed->yp_domain = NULL; +#endif } int