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
deadc43e
Commit
deadc43e
authored
Nov 21, 2014
by
Carlos Martín Nieto
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2720 from ravindp/master
Fix for memory leak issue in indexer.c, that surfaces on windows
parents
c89f1cf9
7561f98d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
src/indexer.c
+6
-6
No files found.
src/indexer.c
View file @
deadc43e
...
...
@@ -120,6 +120,7 @@ int git_indexer_new(
idx
->
progress_cb
=
progress_cb
;
idx
->
progress_payload
=
progress_payload
;
idx
->
mode
=
mode
?
mode
:
GIT_PACK_FILE_MODE
;
git_hash_ctx_init
(
&
idx
->
hash_ctx
);
git_hash_ctx_init
(
&
idx
->
trailer
);
error
=
git_buf_joinpath
(
&
path
,
prefix
,
suff
);
...
...
@@ -265,7 +266,6 @@ static int store_object(git_indexer *idx)
struct
entry
*
entry
;
git_off_t
entry_size
;
struct
git_pack_entry
*
pentry
;
git_hash_ctx
*
ctx
=
&
idx
->
hash_ctx
;
git_off_t
entry_start
=
idx
->
entry_start
;
entry
=
git__calloc
(
1
,
sizeof
(
*
entry
));
...
...
@@ -274,7 +274,7 @@ static int store_object(git_indexer *idx)
pentry
=
git__calloc
(
1
,
sizeof
(
struct
git_pack_entry
));
GITERR_CHECK_ALLOC
(
pentry
);
git_hash_final
(
&
oid
,
ctx
);
git_hash_final
(
&
oid
,
&
idx
->
hash_
ctx
);
entry_size
=
idx
->
off
-
entry_start
;
if
(
entry_start
>
UINT31_MAX
)
{
entry
->
offset
=
UINT32_MAX
;
...
...
@@ -557,7 +557,7 @@ int git_indexer_append(git_indexer *idx, const void *data, size_t size, git_tran
git_mwindow_close
(
&
w
);
idx
->
entry_start
=
entry_start
;
git_hash_
ctx_
init
(
&
idx
->
hash_ctx
);
git_hash_init
(
&
idx
->
hash_ctx
);
if
(
type
==
GIT_OBJ_REF_DELTA
||
type
==
GIT_OBJ_OFS_DELTA
)
{
error
=
advance_delta_offset
(
idx
,
type
);
...
...
@@ -843,12 +843,10 @@ static int update_header_and_rehash(git_indexer *idx, git_transfer_progress *sta
git_mwindow
*
w
=
NULL
;
git_mwindow_file
*
mwf
;
unsigned
int
left
;
git_hash_ctx
*
ctx
;
mwf
=
&
idx
->
pack
->
mwf
;
ctx
=
&
idx
->
trailer
;
git_hash_
ctx_init
(
ctx
);
git_hash_
init
(
&
idx
->
trailer
);
/* Update the header to include the numer of local objects we injected */
...
...
@@ -1061,5 +1059,7 @@ void git_indexer_free(git_indexer *idx)
git_mutex_unlock
(
&
git__mwindow_mutex
);
}
git_hash_ctx_cleanup
(
&
idx
->
trailer
);
git_hash_ctx_cleanup
(
&
idx
->
hash_ctx
);
git__free
(
idx
);
}
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