Remove redundant NULL check

copy has been used before this point - so it is too late to be concerned
about a NULL pointer now.

This is OK as sstrdup() calls err() on NULL return from the underlying
strdup() call.

Raised by cppcheck.
This commit is contained in:
Alan Barr 2018-10-11 23:28:30 +01:00
parent dfe89cc4f1
commit 88c378154a
1 changed files with 1 additions and 4 deletions

View File

@ -44,10 +44,7 @@ int mkdirp(const char *path, mode_t mode) {
char *sep = strrchr(copy, '/'); char *sep = strrchr(copy, '/');
if (sep == NULL) { if (sep == NULL) {
if (copy != NULL) {
free(copy); free(copy);
copy = NULL;
}
return -1; return -1;
} }
*sep = '\0'; *sep = '\0';