X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=index-pack.c;h=3c768fbc631387b59bbbae3423b65b6a311a702b;hb=0cb21911f49176866ee5170e292d351f4697634e;hp=61eb20e45b993a4dbd3da8954d6ca4bebb64ca13;hpb=9096c660a85c4a3d30f8885c766c34ce0766e869;p=git.git diff --git a/index-pack.c b/index-pack.c index 61eb20e45..3c768fbc6 100644 --- a/index-pack.c +++ b/index-pack.c @@ -139,7 +139,7 @@ static const char *open_pack_file(const char *pack_name) if (!pack_name) { static char tmpfile[PATH_MAX]; snprintf(tmpfile, sizeof(tmpfile), - "%s/pack_XXXXXX", get_object_directory()); + "%s/tmp_pack_XXXXXX", get_object_directory()); output_fd = mkstemp(tmpfile); pack_name = xstrdup(tmpfile); } else @@ -358,6 +358,7 @@ static void sha1_object(const void *data, unsigned long size, if (size != has_size || type != has_type || memcmp(data, has_data, size) != 0) die("SHA1 COLLISION FOUND WITH %s !", sha1_to_hex(sha1)); + free(has_data); } } @@ -690,7 +691,7 @@ static const char *write_index_file(const char *index_name, unsigned char *sha1) if (!index_name) { static char tmpfile[PATH_MAX]; snprintf(tmpfile, sizeof(tmpfile), - "%s/index_XXXXXX", get_object_directory()); + "%s/tmp_idx_XXXXXX", get_object_directory()); fd = mkstemp(tmpfile); index_name = xstrdup(tmpfile); } else {