Re: [PATCH 1/1] change contract between system_path and it's callers

2014-11-28 Thread Philip Oakley
From: Alexander Kuleshov kuleshovm...@gmail.com Sent: Wednesday, November 26, 2014 3:53 AM None of these warrant the code churn, I would say. Sorry, english is not my first language, what did you mean when saying: code churn? Code duplication or something else? -- Hi Alexander, The term

Re: [PATCH 1/1] change contract between system_path and it's callers

2014-11-26 Thread Alexander Kuleshov
Maybe we will discard this patch, because i looked on it and tested with different places, it brings more leaks than before? 2014-11-26 9:53 GMT+06:00 Alexander Kuleshov kuleshovm...@gmail.com: Comparing this with what I sent out... builtin/help.c | 10 +++--- exec_cmd.c | 17

Re: [PATCH 1/1] change contract between system_path and it's callers

2014-11-26 Thread Alexander Kuleshov
What do you think if we create int variable, something like given_config_must_free = 0; and will set up it to 1 in cases where it will be allocated, and than we can free it in the end of cmd_config? I'm reading git source code to understanding git internals and found little memory leak in

Re: [PATCH 1/1] change contract between system_path and it's callers

2014-11-26 Thread Junio C Hamano
Alexander Kuleshov kuleshovm...@gmail.com writes: + setenv(INFOPATH, git_info_path, 1); + free(git_info_path); execlp(info, info, gitman, page, (char *)NULL); die(_(no info viewer handled the request)); We are just about to exec; does this warrant the code churn?

Re: [PATCH 1/1] change contract between system_path and it's callers

2014-11-25 Thread Junio C Hamano
Alexander Kuleshov kuleshovm...@gmail.com writes: Now system_path returns path which is allocated string to callers; It prevents memory leaks in some places. All callers of system_path are owners of path string and they must release it. Signed-off-by: Alexander Kuleshov

Re: [PATCH 1/1] change contract between system_path and it's callers

2014-11-25 Thread Alexander Kuleshov
Comparing this with what I sent out... builtin/help.c | 10 +++--- exec_cmd.c | 17 + exec_cmd.h | 4 ++-- git.c | 16 4 files changed, 30 insertions(+), 17 deletions(-) @@ -372,7 +373,9 @@ static void show_man_page(const