Browse Source

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

tags/v0.9.3
Michael Brown 17 years ago
parent
commit
49009a4c1b
2 changed files with 4 additions and 5 deletions
  1. 2
    3
      src/core/cwuri.c
  2. 2
    2
      src/include/gpxe/uri.h

+ 2
- 3
src/core/cwuri.c View File

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

+ 2
- 2
src/include/gpxe/uri.h View File

105
 /**
105
 /**
106
  * Increment URI reference count
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
 static inline __attribute__ (( always_inline )) struct uri *
111
 static inline __attribute__ (( always_inline )) struct uri *
112
 uri_get ( struct uri *uri ) {
112
 uri_get ( struct uri *uri ) {

Loading…
Cancel
Save