From d92054c8675df2816fe7c9de87216e494853c276 Mon Sep 17 00:00:00 2001 From: Andrea Bolognani Date: Tue, 25 Apr 2023 16:11:07 +0200 Subject: [PATCH] util: Small refactor Prepare for further changes. Signed-off-by: Andrea Bolognani Reviewed-by: Martin Kletzander --- src/util/virfile.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/util/virfile.c b/src/util/virfile.c index 228482e8f8..8e94d19e45 100644 --- a/src/util/virfile.c +++ b/src/util/virfile.c @@ -1743,13 +1743,15 @@ virFindFileInPath(const char *file) return NULL; path = g_find_program_in_path(file); - if (!path) - return NULL; - /* Workaround for a bug in g_find_program_in_path() not returning absolute - * path as documented. TODO drop it once we require GLib >= 2.69.0 - */ - return g_canonicalize_filename(path, NULL); + if (path) { + /* Workaround for a bug in g_find_program_in_path() not returning absolute + * path as documented. TODO drop it once we require GLib >= 2.69.0 + */ + return g_canonicalize_filename(path, NULL); + } + + return NULL; }