Browse Source

[uri] Special case NULL in churi()

resolve_uri() doesn't (and probably shouldn't) handle NULL relative_uri.

Signed-off-by: Piotr Jaroszyński <p.jaroszynski@gmail.com>
Reviewed-by: Stefan Hajnoczi <stefanha@gmail.com>
Signed-off-by: Marty Connor <mdc@etherboot.org>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Piotr Jaroszyński 14 years ago
parent
commit
61206c245d
1 changed files with 4 additions and 2 deletions
  1. 4
    2
      src/core/cwuri.c

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

38
  * @v uri		New working URI, or NULL
38
  * @v uri		New working URI, or NULL
39
  */
39
  */
40
 void churi ( struct uri *uri ) {
40
 void churi ( struct uri *uri ) {
41
-	struct uri *new_uri;
41
+	struct uri *new_uri = NULL;
42
+
43
+	if ( uri )
44
+		new_uri = resolve_uri ( cwuri, uri );
42
 
45
 
43
-	new_uri = resolve_uri ( cwuri, uri );
44
 	uri_put ( cwuri );
46
 	uri_put ( cwuri );
45
 	cwuri = new_uri;
47
 	cwuri = new_uri;
46
 }
48
 }

Loading…
Cancel
Save