If realloc() == NULL we lost the pointer to old memory 56/13156/5
authorPat Riehecky <riehecky@fnal.gov>
Fri, 1 Jun 2018 20:59:37 +0000 (15:59 -0500)
committerBenjamin Kaduk <kaduk@mit.edu>
Mon, 15 Feb 2021 01:03:46 +0000 (20:03 -0500)
commit441c00c430f8af30be425a51bc5fbe0d6c005afa
treedb9152e63217b1ae15bdcbcc49a1658ceb51fe32
parent9338cb5fce2e38b864b8f957b6ea4c56c78d20f8
If realloc() == NULL we lost the pointer to old memory

Systems under memory pressure may fail to realloc().  If so, the pointer
to the old memory is lost, but not released.  This code catches the
pointer before hand to ensure the memory isn't leaked. (via cppcheck)

Change-Id: I4c5a11c1daf4e78f7ffde71af0175d9106f6c3cd
Reviewed-on: https://gerrit.openafs.org/13156
Reviewed-by: Joe Gorse <jhgorse@gmail.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
src/tools/dumpscan/parsevnode.c
src/tools/dumpscan/pathname.c
src/tools/dumpscan/primitive.c