Skip to content

Commit c2d7c74

Browse files
committed
Merge branch 'jk/transport-color-leakfix' into next
Leakfix. * jk/transport-color-leakfix: transport: plug leaks in transport_color_config()
2 parents 5637409 + 2594747 commit c2d7c74

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
@@ -48,21 +48,21 @@ static int transport_color_config(void)
4848
"color.transport.reset",
4949
"color.transport.rejected"
5050
}, *key = "color.transport";
51-
char *value;
51+
const char *value;
5252
static int initialized;
5353

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

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

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

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

0 commit comments

Comments
 (0)