Skip to content
Snippets Groups Projects
Commit 07b8ff7d authored by Andrzej Hunt's avatar Andrzej Hunt Committed by Junio C Hamano
Browse files

init-db: silence template_dir leak when converting to absolute path


template_dir starts off pointing to either argv or nothing. However if
the value supplied in argv is a relative path, absolute_pathdup() is
used to turn it into an absolute path. absolute_pathdup() allocates
a new string, and we then "leak" it when cmd_init_db() completes.

We don't bother to actually free the return value (instead we UNLEAK
it), because there's no significant advantage to doing so here.
Correctly freeing it would require more significant changes to code flow
which would be more noisy than beneficial.

Signed-off-by: default avatarAndrzej Hunt <ajrhunt@google.com>
Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
parent 3a2c316f
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment