svn commit: r267436 - head/lib/libiconv_modules/HZ

Tijl Coosemans tijl at FreeBSD.org
Fri Jun 13 08:26:54 UTC 2014


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);


More information about the svn-src-all mailing list