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:
bdrewery 2015-10-29 18:29:28 +00:00
parent 3d8826f0c9
commit ef07697d65

View File

@ -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';
/*