From f25c1757c11b5642fbb4a38f1ed7fbeef5bb3c1f Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Fri, 2 Dec 2016 17:01:19 +0100 Subject: [PATCH 1/1] util-lib: drop unnecessary NULL check DEFINE_TRIVIAL_CLEANUP_FUNC() already does that check, no need to duplicate it. --- src/basic/rm-rf.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/basic/rm-rf.h b/src/basic/rm-rf.h index f693a5bb7..e13f7003e 100644 --- a/src/basic/rm-rf.h +++ b/src/basic/rm-rf.h @@ -33,8 +33,6 @@ int rm_rf(const char *path, RemoveFlags flags); /* Useful for usage with _cleanup_(), destroys a directory and frees the pointer */ static inline void rm_rf_physical_and_free(char *p) { - if (!p) - return; (void) rm_rf(p, REMOVE_ROOT|REMOVE_PHYSICAL); free(p); } -- 2.30.2