diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/diff.c | 3 | ||||
-rw-r--r-- | src/index.c | 1 | ||||
-rw-r--r-- | src/transports/smart_protocol.c | 6 |
3 files changed, 9 insertions, 1 deletions
diff --git a/src/diff.c b/src/diff.c index a154e67e8..fbff1a6fb 100644 --- a/src/diff.c +++ b/src/diff.c @@ -716,7 +716,7 @@ static int diff_scan_inside_untracked_dir( error = git_iterator_advance(&info->nitem, info->new_iter); } - return error; + goto done; } /* look for actual untracked file */ @@ -747,6 +747,7 @@ static int diff_scan_inside_untracked_dir( break; } +done: git_buf_free(&base); return error; diff --git a/src/index.c b/src/index.c index d4aa475a9..ee659f8ab 100644 --- a/src/index.c +++ b/src/index.c @@ -349,6 +349,7 @@ static void index_free(git_index *index) { git_index_clear(index); git_vector_free(&index->entries); + git_vector_free(&index->names); git_vector_free(&index->reuc); git__free(index->index_file_path); diff --git a/src/transports/smart_protocol.c b/src/transports/smart_protocol.c index a5ad1e422..765b914b7 100644 --- a/src/transports/smart_protocol.c +++ b/src/transports/smart_protocol.c @@ -23,10 +23,16 @@ int git_smart__store_refs(transport_smart *t, int flushes) int error, flush = 0, recvd; const char *line_end; git_pkt *pkt; + git_pkt_ref *ref; + size_t i; /* Clear existing refs in case git_remote_connect() is called again * after git_remote_disconnect(). */ + git_vector_foreach(refs, i, ref) { + git__free(ref->head.name); + git__free(ref); + } git_vector_clear(refs); do { |