Skip to content

Commit 106a54a

Browse files
pks-tgitster
authored andcommitted
builtin/log: stop using globals for log config
We're using global variables to store the log configuration. Many of these can be set both via the command line and via the config, and depending on how they are being set, they may contain allocated strings. This leads to hard-to-track memory ownership and memory leaks. Refactor the code to instead use a `struct log_config` that is being allocated on the stack. This allows us to more clearly scope the variables, track memory ownership and ultimately release the memory. This also prepares us for a change to `git_config_string()`, which will be adapted to have a `char **` out parameter instead of `const char **`. Signed-off-by: Patrick Steinhardt <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent a6cb0cc commit 106a54a

File tree

1 file changed

+156
-103
lines changed

1 file changed

+156
-103
lines changed

0 commit comments

Comments
 (0)