diff options
author | Michael Brown | 2014-02-25 15:03:40 +0100 |
---|---|---|
committer | Michael Brown | 2014-02-27 00:34:07 +0100 |
commit | c7b69ac793b7704c09560eb6850e4ec2bd66e575 (patch) | |
tree | 26a3a7bc1f4195ee5c39bf098bc44be43c3c5bf6 /src/core/uri.c | |
parent | [settings] Remove "uristring" setting type (diff) | |
download | ipxe-c7b69ac793b7704c09560eb6850e4ec2bd66e575.tar.gz ipxe-c7b69ac793b7704c09560eb6850e4ec2bd66e575.tar.xz ipxe-c7b69ac793b7704c09560eb6850e4ec2bd66e575.zip |
[params] Use reference counters for form parameter lists
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/core/uri.c')
-rw-r--r-- | src/core/uri.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/core/uri.c b/src/core/uri.c index bc55e4d8..499fb975 100644 --- a/src/core/uri.c +++ b/src/core/uri.c @@ -72,8 +72,7 @@ static void dump_uri ( struct uri *uri ) { static void free_uri ( struct refcnt *refcnt ) { struct uri *uri = container_of ( refcnt, struct uri, refcnt ); - if ( uri->params ) - destroy_parameters ( uri->params ); + params_put ( uri->params ); free ( uri ); } @@ -89,6 +88,7 @@ static void free_uri ( struct refcnt *refcnt ) { */ struct uri * parse_uri ( const char *uri_string ) { struct uri *uri; + struct parameters *params; char *raw; char *tmp; char *path; @@ -111,9 +111,9 @@ struct uri * parse_uri ( const char *uri_string ) { if ( ( tmp = strstr ( raw, "##params" ) ) ) { *tmp = '\0'; tmp += 8 /* "##params" */; - uri->params = find_parameters ( *tmp ? ( tmp + 1 ) : NULL ); - if ( uri->params ) { - claim_parameters ( uri->params ); + params = find_parameters ( *tmp ? ( tmp + 1 ) : NULL ); + if ( params ) { + uri->params = claim_parameters ( params ); } else { /* Ignore non-existent submission blocks */ } |