mirror of
https://github.com/ipxe/ipxe
synced 2025-12-29 19:38:37 +03:00
[params] Use reference counters for form parameter lists
Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
@@ -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 */
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user