summaryrefslogtreecommitdiff
path: root/http-push.c
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <junkio@cox.net>2005-12-03 23:46:02 -0800
committerLibravatar Junio C Hamano <junkio@cox.net>2005-12-03 23:46:02 -0800
commit423325a2d24638ddcc82ce47be5e40be550f4507 (patch)
tree00960b001d786299d3da04a4467bd0c798bf8cda /http-push.c
parentGIT 0.99.9k (diff)
parent[PATCH] daemon.c and path.enter_repo(): revamp path validation. (diff)
downloadtgif-423325a2d24638ddcc82ce47be5e40be550f4507.tar.xz
GIT 0.99.9l aka 1.0rc4
Diffstat (limited to 'http-push.c')
-rw-r--r--http-push.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/http-push.c b/http-push.c
index 76c788673e..fe925609b4 100644
--- a/http-push.c
+++ b/http-push.c
@@ -784,7 +784,7 @@ static void handle_new_lock_ctx(struct xml_ctx *ctx, int tag_closed)
strtol(ctx->cdata + 7, NULL, 10);
} else if (!strcmp(ctx->name, DAV_ACTIVELOCK_TOKEN)) {
if (!strncmp(ctx->cdata, "opaquelocktoken:", 16)) {
- lock->token = xmalloc(strlen(ctx->cdata - 15));
+ lock->token = xmalloc(strlen(ctx->cdata) - 15);
strcpy(lock->token, ctx->cdata + 16);
}
}
@@ -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;
@@ -1239,6 +1237,7 @@ int main(int argc, char **argv)
int rc = 0;
int i;
+ setup_git_directory();
setup_ident();
remote = xmalloc(sizeof(*remote));
@@ -1273,6 +1272,9 @@ int main(int argc, char **argv)
break;
}
+ if (!remote->url)
+ usage(http_push_usage);
+
memset(remote_dir_exists, 0, 256);
http_init();