Browse Source

cmPickup.c: fixed uninitialized 'rsi' in _cmTlFindRecdBefore().

master
kpl 11 years ago
parent
commit
85e1b90c14
1 changed files with 6 additions and 2 deletions
  1. 6
    2
      app/cmPickup.c

+ 6
- 2
app/cmPickup.c View File

@@ -537,6 +537,8 @@ cmPuRC_t _cmPuJsonGainRead( cmPu_t* p, cmJsonH_t jsH, cmJsonNode_t* onp, const c
537 537
 {
538 538
   cmPuRC_t rc = kOkPuRC;
539 539
   cmJsonNode_t* arp;
540
+  unsigned arrCnt = 0;
541
+  cmPuCh_t* arr = NULL;
540 542
 
541 543
   // locate the JSON 'gain' array
542 544
   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
546 548
   }
547 549
 
548 550
   // get the count of elements in the 'gain' array
549
-  unsigned  arrCnt = cmJsonChildCount(arp);
550
-  cmPuCh_t* arr    = NULL;
551
+  arrCnt = cmJsonChildCount(arp);
551 552
 
552 553
   if( arrCnt > 0 )
553 554
   {
@@ -572,7 +573,10 @@ cmPuRC_t _cmPuJsonGainRead( cmPu_t* p, cmJsonH_t jsH, cmJsonNode_t* onp, const c
572 573
  errLabel:
573 574
 
574 575
   if( rc != kOkPuRC )
576
+  {
575 577
     cmMemPtrFree(&arr);
578
+    arrCnt = 0;
579
+  }
576 580
 
577 581
   cmMemPtrFree(&p->chArray);
578 582
   p->chArray = arr;

Loading…
Cancel
Save