summaryrefslogtreecommitdiffstats
path: root/freebsd/lib/libc/resolv/mtctxres.c
diff options
context:
space:
mode:
Diffstat (limited to 'freebsd/lib/libc/resolv/mtctxres.c')
-rw-r--r--freebsd/lib/libc/resolv/mtctxres.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/freebsd/lib/libc/resolv/mtctxres.c b/freebsd/lib/libc/resolv/mtctxres.c
index 6ba2bc97..f4fd36a5 100644
--- a/freebsd/lib/libc/resolv/mtctxres.c
+++ b/freebsd/lib/libc/resolv/mtctxres.c
@@ -77,7 +77,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);
}
@@ -96,10 +96,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
@@ -134,9 +131,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);
}
}