|
@@ -77,13 +77,12 @@ struct uri * parse_uri ( const char *uri_string ) {
|
77
|
77
|
|
78
|
78
|
/* Allocate space for URI struct and a copy of the string */
|
79
|
79
|
raw_len = ( strlen ( uri_string ) + 1 /* NUL */ );
|
80
|
|
- uri = malloc ( sizeof ( *uri ) + raw_len );
|
|
80
|
+ uri = zalloc ( sizeof ( *uri ) + raw_len );
|
81
|
81
|
if ( ! uri )
|
82
|
82
|
return NULL;
|
83
|
83
|
raw = ( ( ( char * ) uri ) + sizeof ( *uri ) );
|
84
|
84
|
|
85
|
85
|
/* Zero URI struct and copy in the raw string */
|
86
|
|
- memset ( uri, 0, sizeof ( *uri ) );
|
87
|
86
|
memcpy ( raw, uri_string, raw_len );
|
88
|
87
|
|
89
|
88
|
/* Start by chopping off the fragment, if it exists */
|