diff options
author | Alan Barr <a.barr@outlook.com> | 2018-10-11 23:28:30 +0100 |
---|---|---|
committer | Alan Barr <a.barr@outlook.com> | 2018-10-13 17:41:50 +0100 |
commit | 88c378154a95eb0c77abd187c6c7f0cac01fe481 (patch) | |
tree | 5477d52b7c414a060105c1c372c7062fdd703c51 /libi3 | |
parent | dfe89cc4f1706a6fae0ae3816787d0fb22dadd7d (diff) | |
download | i3-88c378154a95eb0c77abd187c6c7f0cac01fe481.tar.gz i3-88c378154a95eb0c77abd187c6c7f0cac01fe481.zip |
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.
Diffstat (limited to 'libi3')
-rw-r--r-- | libi3/mkdirp.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/libi3/mkdirp.c b/libi3/mkdirp.c index 1fc8c346..f5281bd7 100644 --- a/libi3/mkdirp.c +++ b/libi3/mkdirp.c @@ -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'; |