Commits

BarryFSmith committed a2613fd

fixed memory leak, PetscToken accidently destroyed inside if () branch

  • Participants
  • Parent commits b45d02c

Comments (0)

Files changed (1)

src/sys/objects/options.c

       tvalue[len-1] = 0;
       ierr = PetscOptionsStringToReal(tvalue,&im);CHKERRQ(ierr);
       if (negim) im = -im;
-      ierr = PetscTokenDestroy(&token);CHKERRQ(ierr);
     } else {
       ierr = PetscStrstr(name,"i",&tvalue);CHKERRQ(ierr);
       if (tvalue) {
         ierr = PetscOptionsStringToReal(name,&re);CHKERRQ(ierr);
       }
     }
+    ierr = PetscTokenDestroy(&token);CHKERRQ(ierr);
 #if defined(PETSC_USE_COMPLEX)
     *a = re + im*PETSC_i;
 #else