Mark Adams <[email protected]> writes:

> I have been getting this memory leak message.  I am calling this from
> fortran.  I've looked at the code and it is not obvious where this comes
> from.
>
> Mark
>
> [30]Total space allocated 16 bytes
> [30]16 bytes PCFieldSplitGetSubKSP_FieldSplit_Schur() line 1233 in
> /global/u2/m/madams/petsc_private/src/ksp/pc/impls/fieldsplit/fieldsplit.c

Looks like Barry forget to free the array that was allocated:

diff --git i/src/ksp/pc/impls/fieldsplit/ftn-custom/zfieldsplitf.c 
w/src/ksp/pc/impls/fieldsplit/ftn-custom/zfieldsplitf.c
index f3bda29..ec0225e 100644
--- i/src/ksp/pc/impls/fieldsplit/ftn-custom/zfieldsplitf.c
+++ w/src/ksp/pc/impls/fieldsplit/ftn-custom/zfieldsplitf.c
@@ -18,5 +18,6 @@ PETSC_EXTERN void PETSC_STDCALL pcfieldsplitgetsubksp_(PC 
*pc,PetscInt *n_local,
   if (ksp) {
     for (i=0; i<nloc; i++) ksp[i] = tksp[i];
   }
+  *ierr =  PetscFree(tksp);
 }
 

Attachment: pgpYtqSm8THc7.pgp
Description: PGP signature

Reply via email to