summaryrefslogtreecommitdiff
path: root/http-push.c
diff options
context:
space:
mode:
authorNick Hengeveld <nickh@reactrix.com>2005-11-29 09:33:36 -0800
committerJunio C Hamano <junkio@cox.net>2005-11-29 10:51:39 -0800
commit3e9fabc85ef44fa0f275dd89738a2dacb7b6f5db (patch)
treeed2ade218860dd84e8b690c6bc453c2adb295d59 /http-push.c
parent2c4ed386e8861e730037abe4f4d9e032c5c46242 (diff)
downloadgit-3e9fabc85ef44fa0f275dd89738a2dacb7b6f5db.tar.gz
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>
Diffstat (limited to 'http-push.c')
-rw-r--r--http-push.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/http-push.c b/http-push.c
index ad789829c1..fc013ec139 100644
--- a/http-push.c
+++ b/http-push.c
@@ -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;
@@ -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();