Date: Fri, 13 Jun 2014 08:26:53 +0000 (UTC) From: Tijl Coosemans <tijl@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267436 - head/lib/libiconv_modules/HZ Message-ID: <201406130826.s5D8Qr0V071160@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: tijl Date: Fri Jun 13 08:26:53 2014 New Revision: 267436 URL: http://svnweb.freebsd.org/changeset/base/267436 Log: Replace malloc+memset with calloc. Modified: head/lib/libiconv_modules/HZ/citrus_hz.c Modified: head/lib/libiconv_modules/HZ/citrus_hz.c ============================================================================== --- head/lib/libiconv_modules/HZ/citrus_hz.c Fri Jun 13 07:33:43 2014 (r267435) +++ head/lib/libiconv_modules/HZ/citrus_hz.c Fri Jun 13 08:26:53 2014 (r267436) @@ -532,10 +532,9 @@ _citrus_HZ_parse_graphic(void *context, p = (void **)context; escape = (escape_t *)p[0]; ei = (_HZEncodingInfo *)p[1]; - graphic = malloc(sizeof(*graphic)); + graphic = calloc(1, sizeof(*graphic)); if (graphic == NULL) return (ENOMEM); - memset(graphic, 0, sizeof(*graphic)); if (strcmp("GL", name) == 0) { if (GL(escape) != NULL) goto release; @@ -598,10 +597,9 @@ _citrus_HZ_parse_escape(void *context, c void *p[2]; ei = (_HZEncodingInfo *)context; - escape = malloc(sizeof(*escape)); + escape = calloc(1, sizeof(*escape)); if (escape == NULL) return (EINVAL); - memset(escape, 0, sizeof(*escape)); if (strcmp("0", name) == 0) { escape->set = E0SET(ei); TAILQ_INSERT_TAIL(E0SET(ei), escape, entry);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201406130826.s5D8Qr0V071160>