From: Michael Tremer Date: Tue, 31 Dec 2024 14:05:45 +0000 (+0000) Subject: path: Convince the static analyzer that path is set X-Git-Tag: 0.9.30~626 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7a2ae190fe0aafceda25f09110d2ad512e9daa91;p=pakfire.git path: Convince the static analyzer that path is set Signed-off-by: Michael Tremer --- 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; }