From: Andrea Bolognani Date: Tue, 25 Apr 2023 14:11:07 +0000 (+0200) Subject: util: Small refactor X-Git-Tag: v9.4.0-rc1~85 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d92054c8675df2816fe7c9de87216e494853c276;p=thirdparty%2Flibvirt.git util: Small refactor Prepare for further changes. Signed-off-by: Andrea Bolognani Reviewed-by: Martin Kletzander --- 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; }