Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion fuzzers/standalone_driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ int main(int argc, char **argv)
fprintf(stderr, "Done %d runs\n", i);

exit:
git_vector_free_deep(&corpus_files);
git_vector_dispose_deep(&corpus_files);
git_libgit2_shutdown();
return error;
}
2 changes: 1 addition & 1 deletion src/cli/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ static int parse_common_options(
if (error && backend)
backend->free(backend);
git_config_free(config);
git_vector_free_deep(&cmdline);
git_vector_dispose_deep(&cmdline);
return error;
}

Expand Down
4 changes: 2 additions & 2 deletions src/libgit2/apply.c
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ static void patch_image_free(patch_image *image)
return;

git_pool_clear(&image->pool);
git_vector_free(&image->lines);
git_vector_dispose(&image->lines);
}

static bool match_hunk(
Expand Down Expand Up @@ -730,7 +730,7 @@ static int git_apply__to_workdir(
error = git_checkout_index(repo, postimage, &checkout_opts);

done:
git_vector_free(&paths);
git_vector_dispose(&paths);
return error;
}

Expand Down
2 changes: 1 addition & 1 deletion src/libgit2/attr.c
Original file line number Diff line number Diff line change
Expand Up @@ -618,7 +618,7 @@ static void release_attr_files(git_vector *files)
git_attr_file__free(file);
files->contents[i] = NULL;
}
git_vector_free(files);
git_vector_dispose(files);
}

static int collect_attr_files(
Expand Down
4 changes: 2 additions & 2 deletions src/libgit2/attr_file.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ int git_attr_file__clear_rules(git_attr_file *file, bool need_lock)

git_vector_foreach(&file->rules, i, rule)
git_attr_rule__free(rule);
git_vector_free(&file->rules);
git_vector_dispose(&file->rules);

if (need_lock)
git_mutex_unlock(&file->lock);
Expand Down Expand Up @@ -996,7 +996,7 @@ static void git_attr_rule__clear(git_attr_rule *rule)
if (!(rule->match.flags & GIT_ATTR_FNMATCH_IGNORE)) {
git_vector_foreach(&rule->assigns, i, assign)
GIT_REFCOUNT_DEC(assign, git_attr_assignment__free);
git_vector_free(&rule->assigns);
git_vector_dispose(&rule->assigns);
}

/* match.pattern is stored in a git_pool, so no need to free */
Expand Down
4 changes: 2 additions & 2 deletions src/libgit2/blame.c
Original file line number Diff line number Diff line change
Expand Up @@ -165,9 +165,9 @@ void git_blame_free(git_blame *blame)

git_vector_foreach(&blame->hunks, i, hunk)
free_hunk(hunk);
git_vector_free(&blame->hunks);
git_vector_dispose(&blame->hunks);

git_vector_free_deep(&blame->paths);
git_vector_dispose_deep(&blame->paths);

git_array_clear(blame->line_index);

Expand Down
6 changes: 3 additions & 3 deletions src/libgit2/checkout.c
Original file line number Diff line number Diff line change
Expand Up @@ -2316,11 +2316,11 @@ static void checkout_data_clear(checkout_data *data)
data->opts.baseline = NULL;
}

git_vector_free(&data->removes);
git_vector_dispose(&data->removes);
git_pool_clear(&data->pool);

git_vector_free_deep(&data->remove_conflicts);
git_vector_free_deep(&data->update_conflicts);
git_vector_dispose_deep(&data->remove_conflicts);
git_vector_dispose_deep(&data->update_conflicts);

git__free(data->pfx);
data->pfx = NULL;
Expand Down
2 changes: 1 addition & 1 deletion src/libgit2/commit_graph.c
Original file line number Diff line number Diff line change
Expand Up @@ -730,7 +730,7 @@ void git_commit_graph_writer_free(git_commit_graph_writer *w)

git_vector_foreach (&w->commits, i, packed_commit)
packed_commit_free(packed_commit);
git_vector_free(&w->commits);
git_vector_dispose(&w->commits);
git_str_dispose(&w->objects_info_dir);
git__free(w);
}
Expand Down
4 changes: 2 additions & 2 deletions src/libgit2/config.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ static void config_free(git_config *config)
git__free(entry);
}

git_vector_free(&config->readers);
git_vector_free(&config->writers);
git_vector_dispose(&config->readers);
git_vector_dispose(&config->writers);
git__free(config);
}

Expand Down
2 changes: 1 addition & 1 deletion src/libgit2/describe.c
Original file line number Diff line number Diff line change
Expand Up @@ -627,7 +627,7 @@ static int describe(
git__free(match);
}
}
git_vector_free(&all_matches);
git_vector_dispose(&all_matches);
git_pqueue_free(&list);
git_revwalk_free(walk);
return error;
Expand Down
2 changes: 1 addition & 1 deletion src/libgit2/diff_generate.c
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ static void diff_generated_free(git_diff *d)
git_diff_generated *diff = (git_diff_generated *)d;

git_attr_session__free(&diff->base.attrsession);
git_vector_free_deep(&diff->base.deltas);
git_vector_dispose_deep(&diff->base.deltas);

git_pathspec__vfree(&diff->pathspec);
git_pool_clear(&diff->base.pool);
Expand Down
4 changes: 2 additions & 2 deletions src/libgit2/diff_parse.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ static void diff_parsed_free(git_diff *d)
git_vector_foreach(&diff->patches, i, patch)
git_patch_free(patch);

git_vector_free(&diff->patches);
git_vector_dispose(&diff->patches);

git_vector_free(&diff->base.deltas);
git_vector_dispose(&diff->base.deltas);
git_pool_clear(&diff->base.pool);

git__memzero(diff, sizeof(*diff));
Expand Down
6 changes: 3 additions & 3 deletions src/libgit2/diff_tform.c
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ int git_diff__merge(
git_pool_strdup_safe(&onto->pool, onto->opts.new_prefix);
}

git_vector_free_deep(&onto_new);
git_vector_dispose_deep(&onto_new);
git_pool_clear(&onto_pool);

return error;
Expand Down Expand Up @@ -424,13 +424,13 @@ static int apply_splits_and_deletes(

/* swap new delta list into place */
git_vector_swap(&diff->deltas, &onto);
git_vector_free(&onto);
git_vector_dispose(&onto);
git_vector_sort(&diff->deltas);

return 0;

on_error:
git_vector_free_deep(&onto);
git_vector_dispose_deep(&onto);

return -1;
}
Expand Down
4 changes: 2 additions & 2 deletions src/libgit2/filter.c
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ static void git_filter_global_shutdown(void)
git__free(fdef);
}

git_vector_free(&filter_registry.filters);
git_vector_dispose(&filter_registry.filters);

git_rwlock_wrunlock(&filter_registry.lock);
git_rwlock_free(&filter_registry.lock);
Expand Down Expand Up @@ -1106,7 +1106,7 @@ static void filter_streams_free(git_vector *streams)

git_vector_foreach(streams, i, stream)
stream->free(stream);
git_vector_free(streams);
git_vector_dispose(streams);
}

int git_filter_list_stream_file(
Expand Down
2 changes: 1 addition & 1 deletion src/libgit2/graph.c
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ int git_graph_reachable_from_any(

done:
git_commit_list_free(&result);
git_vector_free(&list);
git_vector_dispose(&list);
git_revwalk_free(walk);
return error;
}
4 changes: 2 additions & 2 deletions src/libgit2/ignore.c
Original file line number Diff line number Diff line change
Expand Up @@ -428,13 +428,13 @@ void git_ignore__free(git_ignores *ignores)
git_attr_file__free(file);
ignores->ign_path.contents[i] = NULL;
}
git_vector_free(&ignores->ign_path);
git_vector_dispose(&ignores->ign_path);

git_vector_foreach(&ignores->ign_global, i, file) {
git_attr_file__free(file);
ignores->ign_global.contents[i] = NULL;
}
git_vector_free(&ignores->ign_global);
git_vector_dispose(&ignores->ign_global);

git_str_dispose(&ignores->dir);
}
Expand Down
28 changes: 14 additions & 14 deletions src/libgit2/index.c
Original file line number Diff line number Diff line change
Expand Up @@ -503,10 +503,10 @@ static void index_free(git_index *index)

git_index_clear(index);
git_idxmap_free(index->entries_map);
git_vector_free(&index->entries);
git_vector_free(&index->names);
git_vector_free(&index->reuc);
git_vector_free(&index->deleted);
git_vector_dispose(&index->entries);
git_vector_dispose(&index->names);
git_vector_dispose(&index->reuc);
git_vector_dispose(&index->deleted);

git__free(index->index_file_path);

Expand Down Expand Up @@ -786,10 +786,10 @@ static int truncate_racily_clean(git_index *index)
diff_opts.pathspec.count = paths.length;
diff_opts.pathspec.strings = (char **)paths.contents;

if ((error = git_diff_index_to_workdir(&diff, INDEX_OWNER(index), index, &diff_opts)) < 0) {
git_vector_free(&paths);
return error;
}
if ((error = git_diff_index_to_workdir(&diff, INDEX_OWNER(index), index, &diff_opts)) < 0) {
git_vector_dispose(&paths);
return error;
}

git_vector_foreach(&diff->deltas, i, delta) {
entry = (git_index_entry *)git_index_get_bypath(index, delta->old_file.path, 0);
Expand All @@ -805,7 +805,7 @@ static int truncate_racily_clean(git_index *index)

done:
git_diff_free(diff);
git_vector_free(&paths);
git_vector_dispose(&paths);
return 0;
}

Expand Down Expand Up @@ -3091,7 +3091,7 @@ static int write_entries(git_index *index, git_filebuf *file)
}

done:
git_vector_free(&case_sorted);
git_vector_dispose(&case_sorted);
return error;
}

Expand Down Expand Up @@ -3414,7 +3414,7 @@ int git_index_read_tree(git_index *index, const git_tree *tree)
index->dirty = 1;

cleanup:
git_vector_free(&entries);
git_vector_dispose(&entries);
git_idxmap_free(entries_map);
if (error < 0)
return error;
Expand Down Expand Up @@ -3558,8 +3558,8 @@ static int git_index_read_iterator(

done:
git_idxmap_free(new_entries_map);
git_vector_free(&new_entries);
git_vector_free(&remove_entries);
git_vector_dispose(&new_entries);
git_vector_dispose(&remove_entries);
git_iterator_free(index_iterator);
return error;
}
Expand Down Expand Up @@ -3860,7 +3860,7 @@ int git_index_snapshot_new(git_vector *snap, git_index *index)

void git_index_snapshot_release(git_vector *snap, git_index *index)
{
git_vector_free(snap);
git_vector_dispose(snap);

git_atomic32_dec(&index->readers);

Expand Down
4 changes: 2 additions & 2 deletions src/libgit2/indexer.c
Original file line number Diff line number Diff line change
Expand Up @@ -1456,7 +1456,7 @@ void git_indexer_free(git_indexer *idx)
if (idx->have_stream)
git_packfile_stream_dispose(&idx->stream);

git_vector_free_deep(&idx->objects);
git_vector_dispose_deep(&idx->objects);

if (idx->pack->idx_cache) {
struct git_pack_entry *pentry;
Expand All @@ -1467,7 +1467,7 @@ void git_indexer_free(git_indexer *idx)
git_oidmap_free(idx->pack->idx_cache);
}

git_vector_free_deep(&idx->deltas);
git_vector_dispose_deep(&idx->deltas);

git_packfile_free(idx->pack, !idx->pack_committed);

Expand Down
8 changes: 4 additions & 4 deletions src/libgit2/iterator.c
Original file line number Diff line number Diff line change
Expand Up @@ -696,7 +696,7 @@ static int tree_iterator_frame_pop(tree_iterator *iter)

frame = git_array_pop(iter->frames);

git_vector_free(&frame->entries);
git_vector_dispose(&frame->entries);
git_tree_free(frame->tree);

do {
Expand All @@ -709,7 +709,7 @@ static int tree_iterator_frame_pop(tree_iterator *iter)
git_vector_foreach(&frame->similar_trees, i, tree)
git_tree_free(tree);

git_vector_free(&frame->similar_trees);
git_vector_dispose(&frame->similar_trees);

git_str_dispose(&frame->path);

Expand Down Expand Up @@ -1501,7 +1501,7 @@ GIT_INLINE(int) filesystem_iterator_frame_pop(filesystem_iterator *iter)
filesystem_iterator_frame_pop_ignores(iter);

git_pool_clear(&frame->entry_pool);
git_vector_free(&frame->entries);
git_vector_dispose(&frame->entries);

return 0;
}
Expand Down Expand Up @@ -2336,7 +2336,7 @@ void git_iterator_free(git_iterator *iter)

iter->cb->free(iter);

git_vector_free(&iter->pathlist);
git_vector_dispose(&iter->pathlist);
git__free(iter->start);
git__free(iter->end);

Expand Down
2 changes: 1 addition & 1 deletion src/libgit2/mailmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ void git_mailmap_free(git_mailmap *mm)
git_vector_foreach(&mm->entries, idx, entry)
mailmap_entry_free(entry);

git_vector_free(&mm->entries);
git_vector_dispose(&mm->entries);
git__free(mm);
}

Expand Down
Loading