diff options
author | Holger Lubitz <hal@duncan.ol.sub.de> | 2007-06-18 01:24:49 +0200 |
---|---|---|
committer | Holger Lubitz <hal@duncan.ol.sub.de> | 2007-07-06 20:42:05 +0200 |
commit | 75ff85441b95343081ceb58e76682a85155a7a3f (patch) | |
tree | 8a0d320f04df5094015d3dfb57f7fe5252427134 /src/core | |
parent | f77d9469a49a160acf5395a92d782bbe63c18fa0 (diff) | |
download | ipxe-75ff85441b95343081ceb58e76682a85155a7a3f.tar.gz |
convert to zalloc
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/resolv.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/core/resolv.c b/src/core/resolv.c index bee391ac..88fc1184 100644 --- a/src/core/resolv.c +++ b/src/core/resolv.c @@ -116,10 +116,9 @@ static int numeric_resolv ( struct resolv_interface *resolv, struct sockaddr_in *sin; /* Allocate and initialise structure */ - numeric = malloc ( sizeof ( *numeric ) ); + numeric = zalloc ( sizeof ( *numeric ) ); if ( ! numeric ) return -ENOMEM; - memset ( numeric, 0, sizeof ( *numeric ) ); resolv_init ( &numeric->resolv, &null_resolv_ops, &numeric->refcnt ); process_init ( &numeric->process, numeric_step, &numeric->refcnt ); memcpy ( &numeric->sa, sa, sizeof ( numeric->sa ) ); @@ -258,10 +257,9 @@ int resolv ( struct resolv_interface *resolv, const char *name, int rc; /* Allocate and initialise structure */ - mux = malloc ( sizeof ( *mux ) + name_len ); + mux = zalloc ( sizeof ( *mux ) + name_len ); if ( ! mux ) return -ENOMEM; - memset ( mux, 0, sizeof ( *mux ) ); resolv_init ( &mux->parent, &null_resolv_ops, &mux->refcnt ); resolv_init ( &mux->child, &resolv_mux_child_ops, &mux->refcnt ); mux->resolver = resolvers; @@ -388,10 +386,9 @@ int xfer_open_named_socket ( struct xfer_interface *xfer, int semantics, int rc; /* Allocate and initialise structure */ - named = malloc ( sizeof ( *named ) ); + named = zalloc ( sizeof ( *named ) ); if ( ! named ) return -ENOMEM; - memset ( named, 0, sizeof ( *named ) ); xfer_init ( &named->xfer, &named_xfer_ops, &named->refcnt ); resolv_init ( &named->resolv, &named_resolv_ops, &named->refcnt ); named->semantics = semantics; |