From: Junio C Hamano Date: Wed, 16 Mar 2011 20:43:07 GMT Subject: Re: [PATCH] system_path: use a static buffer Message-ID: <7vipvi7q5g.fsf@alter.siamese.dyndns.org> In-Reply-To: <1300293183-26354-1-git-send-email-cmn@elego.de> Carlos Martín Nieto writes: > Make system_path behave like the other path functions by using a > static buffer, fixing a memory leak. > > Also make sure the prefix pointer is always initialized to either > PREFIX or NULL. > > Signed-off-by: Carlos Martín Nieto > --- Have you made sure all the callers are Ok with this change? If somebody called system_path(GIT_EXEC_PATH), saved the result in a variable without copying, and then called system_path(ETC_GITATTRIBUTES), his variable may now have a value unrelated to GIT_EXEC_PATH, and you would fix all such callers to save the value away with strdup().