many: fix remaining check-pointer-deref issues

The updated parsing_hacks.h file uncovered a bunch of extra
things that the check-pointer-deref coccinelle script flags.

This commit fixes them to make the tree check-pointer-deref clean.
This commit is contained in:
Michael Vogt
2026-04-12 15:27:15 +02:00
parent 3c6a713836
commit bd141bd818
126 changed files with 342 additions and 9 deletions
+4
View File
@@ -44,6 +44,8 @@ static int populate_uid_cache(const char *root, Hashmap **ret) {
_cleanup_hashmap_free_ Hashmap *cache = NULL;
int r;
assert(ret);
cache = hashmap_new(&uid_gid_hash_ops);
if (!cache)
return -ENOMEM;
@@ -85,6 +87,8 @@ static int populate_gid_cache(const char *root, Hashmap **ret) {
_cleanup_hashmap_free_ Hashmap *cache = NULL;
int r;
assert(ret);
cache = hashmap_new(&uid_gid_hash_ops);
if (!cache)
return -ENOMEM;
+1
View File
@@ -289,6 +289,7 @@ static int specifier_directory(
unsigned i;
int r;
assert(ret);
assert_cc(ELEMENTSOF(paths_system) == ELEMENTSOF(paths_user));
paths = arg_runtime_scope == RUNTIME_SCOPE_USER ? paths_user : paths_system;