selinux: set missing errno in failure branch
Set errno in open_file() if rolling_append(), which does not set errno, failed, since transitive callers might rely on it. Reported-by: clang-analyzer Signed-off-by: Christian Göttsche <cgzones@googlemail.com> Acked-by: James Carter <jwcart2@gmail.com>
This commit is contained in:
parent
c76b273855
commit
cecbff935b
|
@ -563,8 +563,10 @@ static FILE *open_file(const char *path, const char *suffix,
|
|||
/* This handles the case if suffix is null */
|
||||
path = rolling_append(stack_path, fdetails[i].suffix,
|
||||
sizeof(stack_path));
|
||||
if (!path)
|
||||
if (!path) {
|
||||
errno = ENOMEM;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
rc = stat(path, &fdetails[i].sb);
|
||||
if (rc)
|
||||
|
|
Loading…
Reference in New Issue