Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
git2
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
git2
Commits
6278fbc5
Commit
6278fbc5
authored
Sep 24, 2015
by
Edward Thomson
Committed by
Edward Thomson
May 26, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
patch parsing: squash some memory leaks
parent
f941f035
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
0 deletions
+9
-0
src/patch_parse.c
+7
-0
tests/core/buffer.c
+2
-0
No files found.
src/patch_parse.c
View file @
6278fbc5
...
...
@@ -939,6 +939,10 @@ static void patch_parsed__free(git_patch *p)
git__free
(
patch
->
rename_new_path
);
git__free
(
patch
->
old_path
);
git__free
(
patch
->
new_path
);
git_array_clear
(
patch
->
base
.
hunks
);
git_array_clear
(
patch
->
base
.
lines
);
git__free
(
patch
->
base
.
delta
);
git__free
(
patch
);
}
int
git_patch_from_patchfile
(
...
...
@@ -985,5 +989,8 @@ int git_patch_from_patchfile(
*
out
=
&
patch
->
base
;
done:
if
(
error
<
0
)
patch_parsed__free
(
&
patch
->
base
);
return
error
;
}
tests/core/buffer.c
View file @
6278fbc5
...
...
@@ -847,6 +847,8 @@ void test_core_buffer__decode_base85_fails_gracefully(void)
cl_git_fail
(
git_buf_decode_base85
(
&
buf
,
"truncated"
,
9
,
42
));
cl_assert_equal_sz
(
6
,
buf
.
size
);
cl_assert_equal_s
(
"foobar"
,
buf
.
ptr
);
git_buf_free
(
&
buf
);
}
void
test_core_buffer__classify_with_utf8
(
void
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment