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);
_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to