aboutsummaryrefslogtreecommitdiff
path: root/libi3
diff options
context:
space:
mode:
authorAlan Barr <a.barr@outlook.com>2018-10-11 23:28:30 +0100
committerAlan Barr <a.barr@outlook.com>2018-10-13 17:41:50 +0100
commit88c378154a95eb0c77abd187c6c7f0cac01fe481 (patch)
tree5477d52b7c414a060105c1c372c7062fdd703c51 /libi3
parentdfe89cc4f1706a6fae0ae3816787d0fb22dadd7d (diff)
downloadi3-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.c5
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';