http-push cleanup
The malloc patch from Jan Andres fixed the problem that was causing a segfault when freeing the lock token, and Johannes Schindelin found and fixed a problem when no URL is specified on the command line. Signed-off-by: Nick Hengeveld <nickh@reactrix.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
This commit is contained in:
		
				
					committed by
					
						
						Junio C Hamano
					
				
			
			
				
	
			
			
			
						parent
						
							2c4ed386e8
						
					
				
				
					commit
					3e9fabc85e
				
			@ -1008,9 +1008,7 @@ static int unlock_remote(struct active_lock *lock)
 | 
				
			|||||||
	if (lock->owner != NULL)
 | 
						if (lock->owner != NULL)
 | 
				
			||||||
		free(lock->owner);
 | 
							free(lock->owner);
 | 
				
			||||||
	free(lock->url);
 | 
						free(lock->url);
 | 
				
			||||||
/* Freeing the token causes a segfault...
 | 
					 | 
				
			||||||
	free(lock->token);
 | 
						free(lock->token);
 | 
				
			||||||
*/
 | 
					 | 
				
			||||||
	free(lock);
 | 
						free(lock);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	return rc;
 | 
						return rc;
 | 
				
			||||||
@ -1273,6 +1271,9 @@ int main(int argc, char **argv)
 | 
				
			|||||||
		break;
 | 
							break;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						if (!remote->url)
 | 
				
			||||||
 | 
							usage(http_push_usage);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	memset(remote_dir_exists, 0, 256);
 | 
						memset(remote_dir_exists, 0, 256);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	http_init();
 | 
						http_init();
 | 
				
			||||||
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user