Skip to content

Commit

Permalink
http-push cleanup
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Nick Hengeveld authored and Junio C Hamano committed Nov 29, 2005
1 parent 2c4ed38 commit 3e9fabc
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions http-push.c
Original file line number Diff line number Diff line change
Expand Up @@ -1008,9 +1008,7 @@ static int unlock_remote(struct active_lock *lock)
if (lock->owner != NULL)
free(lock->owner);
free(lock->url);
/* Freeing the token causes a segfault...
free(lock->token);
*/
free(lock);

return rc;
Expand Down Expand Up @@ -1273,6 +1271,9 @@ int main(int argc, char **argv)
break;
}

if (!remote->url)
usage(http_push_usage);

memset(remote_dir_exists, 0, 256);

http_init();
Expand Down

0 comments on commit 3e9fabc

Please sign in to comment.