Fix unlikely memory leak.
It is unlikely since the first check in the function is that dir[0] is '/', but later code changes may make it real. Coverity CID: 1332104
This commit is contained in:
parent
4609a2a6fd
commit
b1585b5a06
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=290153
@ -107,8 +107,10 @@ mkdir_home_parents(int dfd, const char *dir)
|
||||
errx(EX_UNAVAILABLE, "out of memory");
|
||||
|
||||
tmp = strrchr(dirs, '/');
|
||||
if (tmp == NULL)
|
||||
if (tmp == NULL) {
|
||||
free(dirs);
|
||||
return;
|
||||
}
|
||||
tmp[0] = '\0';
|
||||
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user