From 7a2ae190fe0aafceda25f09110d2ad512e9daa91 Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Tue, 31 Dec 2024 14:05:45 +0000 Subject: [PATCH] path: Convince the static analyzer that path is set Signed-off-by: Michael Tremer --- src/libpakfire/path.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/libpakfire/path.c b/src/libpakfire/path.c index 80bd71808..d0123e65c 100644 --- a/src/libpakfire/path.c +++ b/src/libpakfire/path.c @@ -535,20 +535,20 @@ int __pakfire_path_absolute(char* buffer, const size_t length, const char* s) { // Parse the path r = pakfire_path_parse(&path, s); - if (r) - goto ERROR; + if (r < 0) + return r; + + // Make the static analyzer happy + if (!path) + return -EINVAL; // Make it absolute path->is_absolute = 1; // Write back the path r = pakfire_path_to_string(path, buffer, length); - if (r) - goto ERROR; -ERROR: - if (path) - pakfire_path_free(path); + pakfire_path_free(path); return r; } -- 2.47.2