diff options
Diffstat (limited to 'lib/libc/resolv/mtctxres.c')
-rw-r--r-- | lib/libc/resolv/mtctxres.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/lib/libc/resolv/mtctxres.c b/lib/libc/resolv/mtctxres.c index f02a7f5..c2aea38 100644 --- a/lib/libc/resolv/mtctxres.c +++ b/lib/libc/resolv/mtctxres.c @@ -75,7 +75,7 @@ __res_init_ctx(void) { return (0); } - if ((mt = malloc(sizeof (mtctxres_t))) == 0) { + if ((mt = malloc(sizeof(mtctxres_t))) == NULL) { errno = ENOMEM; return (-1); } @@ -94,10 +94,7 @@ __res_init_ctx(void) { static void __res_destroy_ctx(void *value) { - mtctxres_t *mt = (mtctxres_t *)value; - - if (mt != 0) - free(mt); + free(value); } #endif @@ -130,9 +127,9 @@ ___mtctxres(void) { * that fails return a global context. */ if (mt_key_initialized) { - if (((mt = pthread_getspecific(key)) != 0) || + if (((mt = pthread_getspecific(key)) != NULL) || (__res_init_ctx() == 0 && - (mt = pthread_getspecific(key)) != 0)) { + (mt = pthread_getspecific(key)) != NULL)) { return (mt); } } |