diff options
| author | Vicent Marti <tanoku@gmail.com> | 2010-11-16 03:25:26 +0200 |
|---|---|---|
| committer | Vicent Marti <tanoku@gmail.com> | 2010-11-16 03:25:26 +0200 |
| commit | d7c7cab8a41f3baee7e9eb748793c063f925d6fd (patch) | |
| tree | 6603aa952e14cf204a6265f75fe0c433f2db206d /tests/t0401-parse.c | |
| parent | 111e362263966869fbb30e2391b9e6bcef58c407 (diff) | |
| download | libgit2-d7c7cab8a41f3baee7e9eb748793c063f925d6fd.tar.gz | |
Fix memory leak in t0401
Commit object must be internally free'd after each parse attempt, even
it fails.
Signed-off-by: Vicent Marti <tanoku@gmail.com>
Diffstat (limited to 'tests/t0401-parse.c')
| -rw-r--r-- | tests/t0401-parse.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/t0401-parse.c b/tests/t0401-parse.c index 331d3895f..fc5aeff7b 100644 --- a/tests/t0401-parse.c +++ b/tests/t0401-parse.c @@ -252,6 +252,7 @@ BEGIN_TEST(parse_buffer_test) for (i = 0; i < working_commit_count; ++i) { git_commit *commit; + commit = git__malloc(sizeof(git_commit)); memset(commit, 0x0, sizeof(git_commit)); commit->object.repo = repo; @@ -263,6 +264,9 @@ BEGIN_TEST(parse_buffer_test) 0x0) ); + git_commit__free(commit); + + commit = git__malloc(sizeof(git_commit)); memset(commit, 0x0, sizeof(git_commit)); commit->object.repo = repo; |
