Merge branch 'maint-1.5.1' into maint
* maint-1.5.1: fix memory leak in parse_object when check_sha1_signature fails name-rev: tolerate clock skew in committer datesmaint
commit
76026200ee
|
@ -4,6 +4,8 @@
|
||||||
#include "tag.h"
|
#include "tag.h"
|
||||||
#include "refs.h"
|
#include "refs.h"
|
||||||
|
|
||||||
|
#define CUTOFF_DATE_SLOP 86400 /* one day */
|
||||||
|
|
||||||
static const char name_rev_usage[] =
|
static const char name_rev_usage[] =
|
||||||
"git-name-rev [--tags | --refs=<pattern>] ( --all | --stdin | committish [committish...] )\n";
|
"git-name-rev [--tags | --refs=<pattern>] ( --all | --stdin | committish [committish...] )\n";
|
||||||
|
|
||||||
|
@ -208,6 +210,8 @@ int cmd_name_rev(int argc, const char **argv, const char *prefix)
|
||||||
add_object_array((struct object *)commit, *argv, &revs);
|
add_object_array((struct object *)commit, *argv, &revs);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (cutoff)
|
||||||
|
cutoff = cutoff - CUTOFF_DATE_SLOP;
|
||||||
for_each_ref(name_ref, &data);
|
for_each_ref(name_ref, &data);
|
||||||
|
|
||||||
if (transform_stdin) {
|
if (transform_stdin) {
|
||||||
|
|
1
object.c
1
object.c
|
@ -176,6 +176,7 @@ struct object *parse_object(const unsigned char *sha1)
|
||||||
if (buffer) {
|
if (buffer) {
|
||||||
struct object *obj;
|
struct object *obj;
|
||||||
if (check_sha1_signature(sha1, buffer, size, typename(type)) < 0) {
|
if (check_sha1_signature(sha1, buffer, size, typename(type)) < 0) {
|
||||||
|
free(buffer);
|
||||||
error("sha1 mismatch %s\n", sha1_to_hex(sha1));
|
error("sha1 mismatch %s\n", sha1_to_hex(sha1));
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue