[uri] Special case NULL in churi() master
authorPiotr Jaroszyński <p.jaroszynski@gmail.com>
Mon, 12 Apr 2010 15:37:10 +0000 (17:37 +0200)
committerMarty Connor <mdc@etherboot.org>
Tue, 20 Apr 2010 14:02:21 +0000 (10:02 -0400)
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>
src/core/cwuri.c

index 65e01b2..94b26d5 100644 (file)
@@ -38,9 +38,11 @@ struct uri *cwuri = NULL;
  * @v uri              New working URI, or NULL
  */
 void churi ( struct uri *uri ) {
-       struct uri *new_uri;
+       struct uri *new_uri = NULL;
+
+       if ( uri )
+               new_uri = resolve_uri ( cwuri, uri );
 
-       new_uri = resolve_uri ( cwuri, uri );
        uri_put ( cwuri );
        cwuri = new_uri;
 }