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:
Junio C Hamano 2020-01-22 15:07:31 -08:00
commit 42096c778d
1 changed files with 2 additions and 1 deletions

View File

@ -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[])