req: move a variable into the scope where it is used in extract_http_url()
Signed-off-by: Michael Adam <obnox@samba.org>
This commit is contained in:
		
							parent
							
								
									bb2e894e0d
								
							
						
					
					
						commit
						69c348ce6d
					
				@ -192,12 +192,12 @@ static int strip_return_port (char *host)
 | 
				
			|||||||
static int extract_http_url (const char *url, struct request_s *request)
 | 
					static int extract_http_url (const char *url, struct request_s *request)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
        char *p;
 | 
					        char *p;
 | 
				
			||||||
        int len;
 | 
					 | 
				
			||||||
        int port;
 | 
					        int port;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        /* Split the URL on the slash to separate host from path */
 | 
					        /* Split the URL on the slash to separate host from path */
 | 
				
			||||||
        p = strchr (url, '/');
 | 
					        p = strchr (url, '/');
 | 
				
			||||||
        if (p != NULL) {
 | 
					        if (p != NULL) {
 | 
				
			||||||
 | 
					                int len;
 | 
				
			||||||
                len = p - url;
 | 
					                len = p - url;
 | 
				
			||||||
                request->host = (char *) safemalloc (len + 1);
 | 
					                request->host = (char *) safemalloc (len + 1);
 | 
				
			||||||
                memcpy (request->host, url, len);
 | 
					                memcpy (request->host, url, len);
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user