The following commit has been merged in the master branch: commit 327b2dd0db9d00b7a37bfa42fd717b6d557ec22b Author: Cheyenne Wills <cwi...@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 <build...@rampaginggeek.com> Reviewed-by: Michael Meffie <mmef...@sinenomine.net> Reviewed-by: Andrew Deason <adea...@sinenomine.net> src/libafscp/afscp_dir.c | 6 ++++++ src/libafscp/afscp_dirops.c | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) -- OpenAFS Master Repository _______________________________________________ OpenAFS-cvs mailing list OpenAFS-cvs@openafs.org https://lists.openafs.org/mailman/listinfo/openafs-cvs