зеркало из https://github.com/microsoft/git.git
Merge branch 'bc/run-command-nullness-after-free-fix'
C pedantry ;-) fix. * bc/run-command-nullness-after-free-fix: run-command: avoid undefined behavior in exists_in_PATH
This commit is contained in:
Коммит
42096c778d
|
@ -213,8 +213,9 @@ static char *locate_in_PATH(const char *file)
|
|||
static int exists_in_PATH(const char *file)
|
||||
{
|
||||
char *r = locate_in_PATH(file);
|
||||
int found = r != NULL;
|
||||
free(r);
|
||||
return r != NULL;
|
||||
return found;
|
||||
}
|
||||
|
||||
int sane_execvp(const char *file, char * const argv[])
|
||||
|
|
Загрузка…
Ссылка в новой задаче