2010/4/12 Piotr Jaroszyński <[email protected]>: > resolve_uri() doesn't (and probably shouldn't) handle NULL relative_uri. > > Signed-off-by: Piotr Jaroszyński <[email protected]> > --- > src/core/cwuri.c | 6 +++++- > 1 files changed, 5 insertions(+), 1 deletions(-) > > diff --git a/src/core/cwuri.c b/src/core/cwuri.c > index 65e01b2..98e56a6 100644 > --- a/src/core/cwuri.c > +++ b/src/core/cwuri.c > @@ -40,7 +40,11 @@ struct uri *cwuri = NULL; > void churi ( struct uri *uri ) { > struct uri *new_uri; > > - new_uri = resolve_uri ( cwuri, uri ); > + if ( uri ) > + new_uri = resolve_uri ( cwuri, uri ); > + else > + new_uri = uri; > + > uri_put ( cwuri ); > cwuri = new_uri; > } > -- > 1.7.0.4
new_uri = uri makes the uri == NULL case a little less clear than an explicit new_uri = NULL. Or dropping the else and initializing new_uri to NULL. Stefan _______________________________________________ gPXE-devel mailing list [email protected] http://etherboot.org/mailman/listinfo/gpxe-devel
