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.
next
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, '/');
if (sep == NULL) {
if (copy != NULL) {
free(copy);
copy = NULL;
}
free(copy);
return -1;
}
*sep = '\0';