From 2f2c60d7fedc46486a83069163d2cbfc14b4d713 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Wed, 29 Jul 2020 19:09:48 +0200 Subject: [PATCH] path-util: make use of TAKE_PTR() where we can --- src/basic/path-util.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/basic/path-util.c b/src/basic/path-util.c index 986dfe94a4..c4e022b3a1 100644 --- a/src/basic/path-util.c +++ b/src/basic/path-util.c @@ -640,10 +640,8 @@ int find_binary(const char *name, char **ret) { if (access(j, X_OK) >= 0) { /* Found it! */ - if (ret) { - *ret = path_simplify(j, false); - j = NULL; - } + if (ret) + *ret = path_simplify(TAKE_PTR(j), false); return 0; }