OpenAFS Master Repository branch, master, updated. openafs-devel-1_9_2-52-g327b2dd
Gerrit Code Review
gerrit@openafs.org
Thu, 2 Jan 2025 12:21:14 -0500
The following commit has been merged in the master branch:
commit 327b2dd0db9d00b7a37bfa42fd717b6d557ec22b
Author: Cheyenne Wills <cwills@sinenomine.net>
Date: Fri Dec 20 15:29:59 2024 -0700
libafscp: Fix problems found by static analysis
Several static analysis tools have identified various problems:
- missing checks to ensure *alloc was successful (infer)
- memory leak (infer)
- possible null pointer dereference (cppcheck)
To resolve the above problems:
- add checks to ensure *alloc was successful before using the memory
- free memory before returning
- move pointer based assignment to after a check for NULL
This commit is a reorganization of commits developed by Pat Riehecky,
who ran the static analysis tools and developed the fixes.
afscp_dir.c:606: Memory dynamically allocated by `malloc`, indirectly
via call to `afscp_DupFid()` on line 602 is not freed after the last
access at line 606, column 9
afscp_dirops.c:44: Either the condition 'dir==NULL' is redundant or
there is possible null pointer dereference: dir. Null pointer
dereference
Change-Id: I17c8b7b45d581f7c84d8a2930de73783e2ae18be
Reviewed-on: https://gerrit.openafs.org/14712
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
src/libafscp/afscp_dir.c | 6 ++++++
src/libafscp/afscp_dirops.c | 3 ++-
2 files changed, 8 insertions(+), 1 deletion(-)
--
OpenAFS Master Repository