From 85e1b90c14263617bb10b3bb50c5ee22bfad059a Mon Sep 17 00:00:00 2001 From: kpl Date: Tue, 30 Apr 2013 12:29:51 -0700 Subject: [PATCH] cmPickup.c: fixed uninitialized 'rsi' in _cmTlFindRecdBefore(). --- app/cmPickup.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/cmPickup.c b/app/cmPickup.c index ebcc914..1f50ec3 100644 --- a/app/cmPickup.c +++ b/app/cmPickup.c @@ -537,6 +537,8 @@ cmPuRC_t _cmPuJsonGainRead( cmPu_t* p, cmJsonH_t jsH, cmJsonNode_t* onp, const c { cmPuRC_t rc = kOkPuRC; cmJsonNode_t* arp; + unsigned arrCnt = 0; + cmPuCh_t* arr = NULL; // locate the JSON 'gain' array if(( arp = cmJsonFindValue(jsH,label,onp,kArrayTId)) == NULL ) @@ -546,8 +548,7 @@ cmPuRC_t _cmPuJsonGainRead( cmPu_t* p, cmJsonH_t jsH, cmJsonNode_t* onp, const c } // get the count of elements in the 'gain' array - unsigned arrCnt = cmJsonChildCount(arp); - cmPuCh_t* arr = NULL; + arrCnt = cmJsonChildCount(arp); if( arrCnt > 0 ) { @@ -572,7 +573,10 @@ cmPuRC_t _cmPuJsonGainRead( cmPu_t* p, cmJsonH_t jsH, cmJsonNode_t* onp, const c errLabel: if( rc != kOkPuRC ) + { cmMemPtrFree(&arr); + arrCnt = 0; + } cmMemPtrFree(&p->chArray); p->chArray = arr;