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
7808c937
Commit
7808c937
authored
Feb 22, 2016
by
Patrick Steinhardt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
index: plug memory leak in `read_conflict_names`
parent
003c5e46
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
3 deletions
+13
-3
src/index.c
+13
-3
No files found.
src/index.c
View file @
7808c937
...
...
@@ -2193,9 +2193,10 @@ static int read_conflict_names(git_index *index, const char *buffer, size_t size
#define read_conflict_name(ptr) \
len = p_strnlen(buffer, size) + 1; \
if (size < len) \
return index_error_invalid("reading conflict name entries"); \
\
if (size < len) { \
index_error_invalid("reading conflict name entries"); \
goto out_err; \
} \
if (len == 1) \
ptr = NULL; \
else { \
...
...
@@ -2216,6 +2217,15 @@ static int read_conflict_names(git_index *index, const char *buffer, size_t size
read_conflict_name
(
conflict_name
->
theirs
);
if
(
git_vector_insert
(
&
index
->
names
,
conflict_name
)
<
0
)
goto
out_err
;
continue
;
out_err
:
git__free
(
conflict_name
->
ancestor
);
git__free
(
conflict_name
->
ours
);
git__free
(
conflict_name
->
theirs
);
git__free
(
conflict_name
);
return
-
1
;
}
...
...
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