From 4c6e66ceb80c35afea0e35d09c515185069df8ee Mon Sep 17 00:00:00 2001 From: Jon Trulson Date: Fri, 26 Dec 2014 16:15:53 -0700 Subject: [PATCH] tt/mini_isam: Coverity (memory corruption, moderate) --- cde/lib/tt/mini_isam/isrewcurr.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cde/lib/tt/mini_isam/isrewcurr.c b/cde/lib/tt/mini_isam/isrewcurr.c index a7cd1778..abb50ff3 100644 --- a/cde/lib/tt/mini_isam/isrewcurr.c +++ b/cde/lib/tt/mini_isam/isrewcurr.c @@ -203,14 +203,16 @@ _amrewcurr(isfhandle, record, reclen, curpos, recnum, errcode) _amseterrcode(errcode, err); goto ERROR; } - _bytearr_free(curpos); - *curpos = newcurpos; /* * This takes care of new record position if the physical order is in use. */ *recnum = crp->recno; + _bytearr_free(curpos); + crp = NULL; /* was aliased to freed curpos->data */ + *curpos = newcurpos; + _amseterrcode(errcode, ISOK); _issignals_mask(); _isdisk_commit(); -- 2.25.1