Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 23 Jan 2010 07:52:45 +0000 (UTC)
From:      Tim Kientzle <kientzle@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r202869 - head/lib/libarchive
Message-ID:  <201001230752.o0N7qjvS040647@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kientzle
Date: Sat Jan 23 07:52:44 2010
New Revision: 202869
URL: http://svn.freebsd.org/changeset/base/202869

Log:
  Initialize the allocated 'struct zip'.

Modified:
  head/lib/libarchive/archive_write_set_format_zip.c

Modified: head/lib/libarchive/archive_write_set_format_zip.c
==============================================================================
--- head/lib/libarchive/archive_write_set_format_zip.c	Sat Jan 23 07:52:13 2010	(r202868)
+++ head/lib/libarchive/archive_write_set_format_zip.c	Sat Jan 23 07:52:44 2010	(r202869)
@@ -231,7 +231,7 @@ archive_write_set_format_zip(struct arch
 	if (a->format_destroy != NULL)
 		(a->format_destroy)(a);
 
-	zip = (struct zip *) malloc(sizeof(*zip));
+	zip = (struct zip *) calloc(1, sizeof(*zip));
 	if (zip == NULL) {
 		archive_set_error(&a->archive, ENOMEM, "Can't allocate zip data");
 		return (ARCHIVE_FATAL);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201001230752.o0N7qjvS040647>