Skip to content

Commit 067ee91

Browse files
committed
Merge branch 'jk/transport-color-leakfix'
Leakfix. * jk/transport-color-leakfix: transport: plug leaks in transport_color_config()
2 parents b9c55cf + 2594747 commit 067ee91

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

transport.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,21 +47,21 @@ static int transport_color_config(void)
4747
"color.transport.reset",
4848
"color.transport.rejected"
4949
}, *key = "color.transport";
50-
char *value;
50+
const char *value;
5151
static int initialized;
5252

5353
if (initialized)
5454
return 0;
5555
initialized = 1;
5656

57-
if (!repo_config_get_string(the_repository, key, &value))
57+
if (!repo_config_get_string_tmp(the_repository, key, &value))
5858
transport_use_color = git_config_colorbool(key, value);
5959

6060
if (!want_color_stderr(transport_use_color))
6161
return 0;
6262

6363
for (size_t i = 0; i < ARRAY_SIZE(keys); i++)
64-
if (!repo_config_get_string(the_repository, keys[i], &value)) {
64+
if (!repo_config_get_string_tmp(the_repository, keys[i], &value)) {
6565
if (!value)
6666
return config_error_nonbool(keys[i]);
6767
if (color_parse(value, transport_colors[i]) < 0)

0 commit comments

Comments
 (0)