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:
Bryan Drewery 2015-10-29 18:29:28 +00:00
parent 4609a2a6fd
commit b1585b5a06

View File

@ -107,8 +107,10 @@ mkdir_home_parents(int dfd, const char *dir)
errx(EX_UNAVAILABLE, "out of memory"); errx(EX_UNAVAILABLE, "out of memory");
tmp = strrchr(dirs, '/'); tmp = strrchr(dirs, '/');
if (tmp == NULL) if (tmp == NULL) {
free(dirs);
return; return;
}
tmp[0] = '\0'; tmp[0] = '\0';
/* /*