浏览代码

convert to zalloc

tags/v0.9.3
Holger Lubitz 17 年前
父节点
当前提交
6def8592ed
共有 1 个文件被更改,包括 1 次插入2 次删除
  1. 1
    2
      src/core/uri.c

+ 1
- 2
src/core/uri.c 查看文件

@@ -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 */

正在加载...
取消
保存