https://github.com/git/git
Revision 70d19a436dfdc2375f7c80dac85bc08160f6a0f7 authored by Junio C Hamano on 04 June 2017, 01:21:01 UTC, committed by Junio C Hamano on 04 June 2017, 01:21:01 UTC
The codepath in "git am" that is used when running "git rebase"
leaked memory held for the log message of the commits being rebased.

* jk/am-leakfix:
  am: shorten ident_split variable name in get_commit_info()
  am: simplify allocations in get_commit_info()
  am: fix commit buffer leak in get_commit_info()
2 parent s 8a17b25 + 721f5f1
Raw File
Tip revision: 70d19a436dfdc2375f7c80dac85bc08160f6a0f7 authored by Junio C Hamano on 04 June 2017, 01:21:01 UTC
Merge branch 'jk/am-leakfix' into maint
Tip revision: 70d19a4
blob.c
#include "cache.h"
#include "blob.h"

const char *blob_type = "blob";

struct blob *lookup_blob(const unsigned char *sha1)
{
	struct object *obj = lookup_object(sha1);
	if (!obj)
		return create_object(sha1, alloc_blob_node());
	return object_as_type(obj, OBJ_BLOB, 0);
}

int parse_blob_buffer(struct blob *item, void *buffer, unsigned long size)
{
	item->object.parsed = 1;
	return 0;
}
back to top