builtin/fast-import: plug trivial memory leaks
Plug some trivial memory leaks in git-fast-import(1). Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:

committed by
Junio C Hamano

parent
187b623eef
commit
0662f0dacb
@ -206,8 +206,8 @@ static unsigned int object_entry_alloc = 5000;
|
|||||||
static struct object_entry_pool *blocks;
|
static struct object_entry_pool *blocks;
|
||||||
static struct hashmap object_table;
|
static struct hashmap object_table;
|
||||||
static struct mark_set *marks;
|
static struct mark_set *marks;
|
||||||
static const char *export_marks_file;
|
static char *export_marks_file;
|
||||||
static const char *import_marks_file;
|
static char *import_marks_file;
|
||||||
static int import_marks_file_from_stream;
|
static int import_marks_file_from_stream;
|
||||||
static int import_marks_file_ignore_missing;
|
static int import_marks_file_ignore_missing;
|
||||||
static int import_marks_file_done;
|
static int import_marks_file_done;
|
||||||
@ -3274,6 +3274,7 @@ static void option_import_marks(const char *marks,
|
|||||||
read_marks();
|
read_marks();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
free(import_marks_file);
|
||||||
import_marks_file = make_fast_import_path(marks);
|
import_marks_file = make_fast_import_path(marks);
|
||||||
import_marks_file_from_stream = from_stream;
|
import_marks_file_from_stream = from_stream;
|
||||||
import_marks_file_ignore_missing = ignore_missing;
|
import_marks_file_ignore_missing = ignore_missing;
|
||||||
@ -3316,6 +3317,7 @@ static void option_active_branches(const char *branches)
|
|||||||
|
|
||||||
static void option_export_marks(const char *marks)
|
static void option_export_marks(const char *marks)
|
||||||
{
|
{
|
||||||
|
free(export_marks_file);
|
||||||
export_marks_file = make_fast_import_path(marks);
|
export_marks_file = make_fast_import_path(marks);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3357,6 +3359,8 @@ static void option_rewrite_submodules(const char *arg, struct string_list *list)
|
|||||||
free(f);
|
free(f);
|
||||||
|
|
||||||
string_list_insert(list, s)->util = ms;
|
string_list_insert(list, s)->util = ms;
|
||||||
|
|
||||||
|
free(s);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int parse_one_option(const char *option)
|
static int parse_one_option(const char *option)
|
||||||
|
@ -7,6 +7,7 @@ test_description='test git fast-import utility'
|
|||||||
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
|
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
|
||||||
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
|
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
|
||||||
|
|
||||||
|
TEST_PASSES_SANITIZE_LEAK=true
|
||||||
. ./test-lib.sh
|
. ./test-lib.sh
|
||||||
. "$TEST_DIRECTORY"/lib-diff.sh ;# test-lib chdir's into trash
|
. "$TEST_DIRECTORY"/lib-diff.sh ;# test-lib chdir's into trash
|
||||||
|
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
test_description='test exotic situations with marks'
|
test_description='test exotic situations with marks'
|
||||||
|
|
||||||
|
TEST_PASSES_SANITIZE_LEAK=true
|
||||||
. ./test-lib.sh
|
. ./test-lib.sh
|
||||||
|
|
||||||
test_expect_success 'setup dump of basic history' '
|
test_expect_success 'setup dump of basic history' '
|
||||||
|
Reference in New Issue
Block a user