Commits

Dmitry Karpeyev  committed 3b1e2a3

Fixed memory leak in MatSchurComplement.

  • Participants
  • Parent commits bee8352

Comments (0)

Files changed (1)

File src/ksp/ksp/utils/schurm.c

     ierr = VecReciprocal(diag);CHKERRQ(ierr);
     ierr = MatDuplicate(A01,MAT_COPY_VALUES,&AdB);CHKERRQ(ierr);
     ierr = MatDiagonalScale(AdB,diag,NULL);CHKERRQ(ierr);
+    ierr = VecDestroy(&diag);CHKERRQ(ierr);
     Sp       = (preuse == MAT_REUSE_MATRIX) ? *Spmat : (Mat)0;
     ierr     = MatMatMult(A10,AdB,preuse,PETSC_DEFAULT,&Sp);CHKERRQ(ierr);
     if (!A11) {