diff options
author | Joris Vink <joris@cvs.openbsd.org> | 2005-12-10 20:27:47 +0000 |
---|---|---|
committer | Joris Vink <joris@cvs.openbsd.org> | 2005-12-10 20:27:47 +0000 |
commit | 9eb5d4f85893529cdca5a54796e344ecb6581196 (patch) | |
tree | f6078dc6aa0b2687219c6431ba7f872b4326c298 /usr.bin/cvs/zlib.c | |
parent | cc2c3fa0314517ddf972b8ca44e9d25aee920bc1 (diff) |
switch to xmalloc stuff, me and xsa@ agreed on this a long
time ago, but we were being held back by jfb. too bad for him.
next step is to use fatal() through out the code for unrecoverable
errors instead of trying to be all nice and fluffy and reach main() again.
ok niallo@ and xsa@
Diffstat (limited to 'usr.bin/cvs/zlib.c')
-rw-r--r-- | usr.bin/cvs/zlib.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/usr.bin/cvs/zlib.c b/usr.bin/cvs/zlib.c index fb1bd30ee06..55d4d205a96 100644 --- a/usr.bin/cvs/zlib.c +++ b/usr.bin/cvs/zlib.c @@ -1,4 +1,4 @@ -/* $OpenBSD: zlib.c,v 1.3 2005/07/25 12:05:43 xsa Exp $ */ +/* $OpenBSD: zlib.c,v 1.4 2005/12/10 20:27:45 joris Exp $ */ /* * Copyright (c) 2005 Jean-Francois Brousseau <jfb@openbsd.org> * All rights reserved. @@ -60,7 +60,7 @@ cvs_zlib_newctx(int level) return (NULL); } - ctx = (CVSZCTX *)malloc(sizeof(*ctx)); + ctx = (CVSZCTX *)xmalloc(sizeof(*ctx)); if (ctx == NULL) { cvs_log(LP_ERRNO, "failed to allocate zlib context"); return (NULL); @@ -79,7 +79,7 @@ cvs_zlib_newctx(int level) if ((inflateInit(&(ctx->z_instrm)) != Z_OK) || (deflateInit(&(ctx->z_destrm), level) != Z_OK)) { cvs_log(LP_ERR, "failed to initialize zlib streams"); - free(ctx); + xfree(ctx); return (NULL); } @@ -98,7 +98,7 @@ cvs_zlib_free(CVSZCTX *ctx) if (ctx != NULL) { (void)inflateEnd(&(ctx->z_instrm)); (void)deflateEnd(&(ctx->z_destrm)); - free(ctx); + xfree(ctx); } } |