summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: fff8fd5)
raw | patch | inline | side by side (parent: fff8fd5)
author | Johannes Schindelin <Johannes.Schindelin@gmx.de> | |
Sat, 29 Jul 2006 00:10:07 +0000 (02:10 +0200) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Sat, 29 Jul 2006 00:13:00 +0000 (17:13 -0700) |
With the latest changes in fetch.c, http-fetch crashed accessing
write_ref[i], where write_ref was NULL.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
write_ref[i], where write_ref was NULL.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
fetch.c | patch | blob | history |
index 2151c7b78c34f06f38f538f155169a0501c2ff54..aeb6bf2639cc75b6f738348bcc267179a8a0da65 100644 (file)
--- a/fetch.c
+++ b/fetch.c
{
while (targets--) {
free(target[targets]);
- if (write_ref[targets])
+ if (write_ref && write_ref[targets])
free((char *) write_ref[targets]);
}
}
track_object_refs = 0;
for (i = 0; i < targets; i++) {
- if (!write_ref[i])
+ if (!write_ref || !write_ref[i])
continue;
lock[i] = lock_ref_sha1(write_ref[i], NULL, 0);
msg = NULL;
}
for (i = 0; i < targets; i++) {
- if (!write_ref[i])
+ if (!write_ref || !write_ref[i])
continue;
ret = write_ref_sha1(lock[i], &sha1[20 * i], msg ? msg : "fetch (unknown)");
lock[i] = NULL;