summaryrefslogtreecommitdiff
path: root/src/git/commit.h
diff options
context:
space:
mode:
authorVicent Marti <tanoku@gmail.com>2010-06-09 14:54:22 +0200
committerVicent Marti <tanoku@gmail.com>2010-07-10 12:15:12 -0700
commit088a731f00a39fb3158dc9150b7c8d176df51867 (patch)
treed25c9bb2bf4c052f41ead5328a068f6828d75ba2 /src/git/commit.h
parent58b0cbea74c160c61ec70768568e150c4d31f633 (diff)
downloadlibgit2-088a731f00a39fb3158dc9150b7c8d176df51867.tar.gz
Fixed memory leaks in test suite
Created commit objects in t0401-parse weren't being freed properly. Updated the API documentation to note that commit objects are owned by the revision pool and should not be freed manually. The parents list of each commit was being freed twice after each test. Signed-off-by: Vicent Marti <tanoku@gmail.com>
Diffstat (limited to 'src/git/commit.h')
-rw-r--r--src/git/commit.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/git/commit.h b/src/git/commit.h
index 1a57ba732..0ccf3c246 100644
--- a/src/git/commit.h
+++ b/src/git/commit.h
@@ -18,6 +18,9 @@ typedef struct git_commit git_commit;
/**
* Locate a reference to a commit without loading it.
+ * The generated commit object is owned by the revision
+ * pool and shall not be freed by the user.
+ *
* @param pool the pool to use when locating the commit.
* @param id identity of the commit to locate. If the object is
* an annotated tag it will be peeled back to the commit.
@@ -28,6 +31,9 @@ GIT_EXTERN(git_commit *) git_commit_lookup(git_revpool *pool, const git_oid *id)
/**
* Locate a reference to a commit, and try to load and parse it it from
* the commit cache or the object database.
+ * The generated commit object is owned by the revision
+ * pool and shall not be freed by the user.
+ *
* @param pool the pool to use when parsing/caching the commit.
* @param id identity of the commit to locate. If the object is
* an annotated tag it will be peeled back to the commit.