From: Holger Lubitz Date: Sun, 17 Jun 2007 23:24:51 +0000 (+0200) Subject: convert to zalloc X-Git-Tag: v0.9.3~272 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6def8592ed406e4ecc3289f22039bf3cdfdcf05c;p=thirdparty%2Fipxe.git convert to zalloc --- diff --git a/src/core/uri.c b/src/core/uri.c index 8cb855a6b..3b3cf85b9 100644 --- a/src/core/uri.c +++ b/src/core/uri.c @@ -77,13 +77,12 @@ struct uri * parse_uri ( const char *uri_string ) { /* Allocate space for URI struct and a copy of the string */ raw_len = ( strlen ( uri_string ) + 1 /* NUL */ ); - uri = malloc ( sizeof ( *uri ) + raw_len ); + uri = zalloc ( sizeof ( *uri ) + raw_len ); if ( ! uri ) return NULL; raw = ( ( ( char * ) uri ) + sizeof ( *uri ) ); /* Zero URI struct and copy in the raw string */ - memset ( uri, 0, sizeof ( *uri ) ); memcpy ( raw, uri_string, raw_len ); /* Start by chopping off the fragment, if it exists */