1. petsc
  2. PETSc
  3. petsc

Commits

BarryFSmith  committed 91e3840

remove memory leak in PCSetUp_Residual() when it is called multiple times with the same nonzero pattern

Reported-By: Fabian Gabel <fabiangabel@hotmail.de>

  • Participants
  • Parent commits a76eec0
  • Branches master

Comments (0)

Files changed (1)

File src/ksp/pc/impls/redistribute/redistribute.c

View file
   }
 
   /* get diagonal portion of matrix */
+  ierr = PetscFree(red->diag);CHKERRQ(ierr);
   ierr = PetscMalloc(red->dcnt*sizeof(PetscScalar),&red->diag);CHKERRQ(ierr);
   ierr = MatGetVecs(pc->pmat,&diag,NULL);CHKERRQ(ierr);
   ierr = MatGetDiagonal(pc->pmat,diag);CHKERRQ(ierr);