浏览代码

uri_get(NULL) and uri_put(NULL) are explicitly allowed.

tags/v0.9.3
Michael Brown 17 年前
父节点
当前提交
49009a4c1b
共有 2 个文件被更改,包括 4 次插入5 次删除
  1. 2
    3
      src/core/cwuri.c
  2. 2
    2
      src/include/gpxe/uri.h

+ 2
- 3
src/core/cwuri.c 查看文件

@@ -33,10 +33,9 @@ struct uri *cwuri = NULL;
33 33
 /**
34 34
  * Change working URI
35 35
  *
36
- * @v uri		New working URI
36
+ * @v uri		New working URI, or NULL
37 37
  */
38 38
 void churi ( struct uri *uri ) {
39
-	if ( cwuri )
40
-		uri_put ( cwuri );
39
+	uri_put ( cwuri );
41 40
 	cwuri = uri_get ( uri );
42 41
 }

+ 2
- 2
src/include/gpxe/uri.h 查看文件

@@ -105,8 +105,8 @@ static inline int uri_has_relative_path ( struct uri *uri ) {
105 105
 /**
106 106
  * Increment URI reference count
107 107
  *
108
- * @v uri		URI
109
- * @ret uri		URI
108
+ * @v uri		URI, or NULL
109
+ * @ret uri		URI as passed in
110 110
  */
111 111
 static inline __attribute__ (( always_inline )) struct uri *
112 112
 uri_get ( struct uri *uri ) {

正在加载...
取消
保存