# PetscViewerStringSetOwnString
tells the viewer that it now owns the string and is responsible for freeing it 
## Synopsis
```
#include "petscsys.h"  
PetscErrorCode PetscViewerStringSetOwnString(PetscViewer viewer)
```
Logically Collective


## Input Parameters

- ***viewer -*** string viewer





## Note
If you call this the string must have been obtained with `PetscMalloc()` and you cannot free the string


## See Also
 [](sec_viewers), `PetscViewerStringOpen()`, `PETSCVIEWERSTRING`, `PetscViewerStringGetStringRead()`, `PetscViewerStringSPrintf()`,
`PetscViewerStringSetString()`

## Level
advanced

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/sys/classes/viewer/impls/string/stringv.c.html#PetscViewerStringSetOwnString">src/sys/classes/viewer/impls/string/stringv.c</A>


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/sys/classes/viewer/impls/string/stringv.c)


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