Date: Tue, 29 Dec 2009 23:15:55 +0000 (UTC) From: "Bjoern A. Zeeb" <bz@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org Subject: svn commit: r201228 - stable/7/sys/opencrypto Message-ID: <200912292315.nBTNFtNX039390@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: bz Date: Tue Dec 29 23:15:55 2009 New Revision: 201228 URL: http://svn.freebsd.org/changeset/base/201228 Log: "Merge" a single file out of r184205 by des@ w/o placing mergeinfo to be able to keep files in sync between branches and still allow a possible of the entire commit: Retire the MALLOC and FREE macros. They are an abomination unto style(9). Modified: stable/7/sys/opencrypto/deflate.c Modified: stable/7/sys/opencrypto/deflate.c ============================================================================== --- stable/7/sys/opencrypto/deflate.c Tue Dec 29 22:53:27 2009 (r201227) +++ stable/7/sys/opencrypto/deflate.c Tue Dec 29 23:15:55 2009 (r201228) @@ -79,7 +79,7 @@ deflate_global(data, size, decomp, out) zbuf.avail_in = size; /* Total length of data to be processed */ if (!decomp) { - MALLOC(buf[i].out, u_int8_t *, (u_long) size, M_CRYPTO_DATA, + buf[i].out = malloc((u_long) size, M_CRYPTO_DATA, M_NOWAIT); if (buf[i].out == NULL) goto bad; @@ -94,7 +94,7 @@ deflate_global(data, size, decomp, out) * updated while the decompression is going on */ - MALLOC(buf[i].out, u_int8_t *, (u_long) (size * 4), + buf[i].out = malloc((u_long) (size * 4), M_CRYPTO_DATA, M_NOWAIT); if (buf[i].out == NULL) goto bad; @@ -121,7 +121,7 @@ deflate_global(data, size, decomp, out) goto end; else if (zbuf.avail_out == 0 && i < (ZBUF - 1)) { /* we need more output space, allocate size */ - MALLOC(buf[i].out, u_int8_t *, (u_long) size, + buf[i].out = malloc((u_long) size, M_CRYPTO_DATA, M_NOWAIT); if (buf[i].out == NULL) goto bad; @@ -137,7 +137,7 @@ deflate_global(data, size, decomp, out) end: result = count = zbuf.total_out; - MALLOC(*out, u_int8_t *, (u_long) result, M_CRYPTO_DATA, M_NOWAIT); + *out = malloc((u_long) result, M_CRYPTO_DATA, M_NOWAIT); if (*out == NULL) goto bad; if (decomp) @@ -149,13 +149,13 @@ end: if (count > buf[j].size) { bcopy(buf[j].out, *out, buf[j].size); *out += buf[j].size; - FREE(buf[j].out, M_CRYPTO_DATA); + free(buf[j].out, M_CRYPTO_DATA); count -= buf[j].size; } else { /* it should be the last buffer */ bcopy(buf[j].out, *out, count); *out += count; - FREE(buf[j].out, M_CRYPTO_DATA); + free(buf[j].out, M_CRYPTO_DATA); count = 0; } } @@ -165,7 +165,7 @@ end: bad: *out = NULL; for (j = 0; buf[j].flag != 0; j++) - FREE(buf[j].out, M_CRYPTO_DATA); + free(buf[j].out, M_CRYPTO_DATA); if (decomp) inflateEnd(&zbuf); else
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200912292315.nBTNFtNX039390>