diff options
author | Ted Unangst <tedu@cvs.openbsd.org> | 2014-05-25 17:47:05 +0000 |
---|---|---|
committer | Ted Unangst <tedu@cvs.openbsd.org> | 2014-05-25 17:47:05 +0000 |
commit | 1c431de626436f2f5f9bf86396d78c7f5f2715eb (patch) | |
tree | 92ffd4edd64d7fbd3e67c990f968261174bf2e5a /lib/libc/yp/yp_bind.c | |
parent | 3f90c9ad3715e333161592a733268dfc720c2a15 (diff) |
use calloc, from Benjamin Baier
Diffstat (limited to 'lib/libc/yp/yp_bind.c')
-rw-r--r-- | lib/libc/yp/yp_bind.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/libc/yp/yp_bind.c b/lib/libc/yp/yp_bind.c index dc33bf28202..da9bf3f72e4 100644 --- a/lib/libc/yp/yp_bind.c +++ b/lib/libc/yp/yp_bind.c @@ -1,4 +1,4 @@ -/* $OpenBSD: yp_bind.c,v 1.19 2013/09/30 12:02:36 millert Exp $ */ +/* $OpenBSD: yp_bind.c,v 1.20 2014/05/25 17:47:04 tedu Exp $ */ /* * Copyright (c) 1992, 1993, 1996 Theo de Raadt <deraadt@theos.com> * All rights reserved. @@ -97,9 +97,8 @@ _yp_dobind(const char *dom, struct dom_binding **ypdb) if (strcmp(dom, ysd->dom_domain) == 0) break; if (ysd == NULL) { - if ((ysd = malloc(sizeof *ysd)) == NULL) + if ((ysd = calloc(1, sizeof *ysd)) == NULL) return YPERR_RESRC; - (void)memset(ysd, 0, sizeof *ysd); ysd->dom_socket = -1; ysd->dom_vers = 0; new = 1; |