summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: e871b64)
raw | patch | inline | side by side (parent: e871b64)
author | Linus Torvalds <torvalds@ppc970.osdl.org> | |
Thu, 26 May 2005 01:27:14 +0000 (18:27 -0700) | ||
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | |
Thu, 26 May 2005 01:27:14 +0000 (18:27 -0700) |
object.
A fair number of the users potentially want to look at the
commit objects more closely, and if you worry about memory
leaking in certain applications, you can always do a
free(commit->buffer);
commit->buffer = NULL;
by hand after parsing them.
A fair number of the users potentially want to look at the
commit objects more closely, and if you worry about memory
leaking in certain applications, you can always do a
free(commit->buffer);
commit->buffer = NULL;
by hand after parsing them.
commit.c | patch | blob | history | |
commit.h | patch | blob | history |
diff --git a/commit.c b/commit.c
index b4e000e9c2cdc726271bdc3ced9c2534848d18de..abbf155da938cf675696e812b4083c8a773ffab0 100644 (file)
--- a/commit.c
+++ b/commit.c
sha1_to_hex(item->object.sha1));
}
ret = parse_commit_buffer(item, buffer, size);
+ if (!ret) {
+ item->buffer = buffer;
+ return 0;
+ }
free(buffer);
return ret;
}
diff --git a/commit.h b/commit.h
index 620e936bbc70d713ac351af3a2950400579841dc..0bb8779ca740af3b474eae8c5019ef309cc8021c 100644 (file)
--- a/commit.h
+++ b/commit.h
unsigned long date;
struct commit_list *parents;
struct tree *tree;
+ const char *buffer;
};
extern const char *commit_type;