# PetscFree2
Frees 2 chunks of memory obtained with `PetscMalloc2()` 
## Synopsis
```
#include <petscsys.h>
PetscErrorCode PetscFree2(void *memory1,void *memory2)
```
Not Collective


## Input Parameters

- ***memory1 -*** memory to free
- ***memory2 -*** 2nd memory to free





## Notes
Memory must have been obtained with `PetscMalloc2()`


## See Also
 `PetscNew()`, `PetscMalloc()`, `PetscMalloc2()`, `PetscFree()`


## Level
developer

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/include/petscsys.h.html#PetscFree2">include/petscsys.h</A>

## Examples
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/vec/vec/tutorials/ex44.c.html">src/vec/vec/tutorials/ex44.c.html</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/vec/is/sf/tutorials/ex1.c.html">src/vec/is/sf/tutorials/ex1.c.html</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/mat/tutorials/ex17.c.html">src/mat/tutorials/ex17.c.html</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/mat/tutorials/ex18.c.html">src/mat/tutorials/ex18.c.html</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/mat/tutorials/ex4.c.html">src/mat/tutorials/ex4.c.html</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/ksp/tutorials/ex68.c.html">src/ksp/ksp/tutorials/ex68.c.html</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/ksp/tutorials/ex69.c.html">src/ksp/ksp/tutorials/ex69.c.html</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/ksp/tutorials/ex74.c.html">src/ksp/ksp/tutorials/ex74.c.html</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/ksp/tutorials/ex77.c.html">src/ksp/ksp/tutorials/ex77.c.html</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/snes/tutorials/ex12.c.html">src/snes/tutorials/ex12.c.html</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/snes/tutorials/ex13.c.html">src/snes/tutorials/ex13.c.html</A><BR>


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/include/petscsys.h)


[Index of all Sys routines](index.md)  
[Table of Contents for all manual pages](/docs/manualpages/index.md)  
[Index of all manual pages](/docs/manualpages/singleindex.md)  
