diff options
Diffstat (limited to 'pb_decode.h')
-rw-r--r-- | pb_decode.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/pb_decode.h b/pb_decode.h index f71b5f1b..2e1da5a6 100644 --- a/pb_decode.h +++ b/pb_decode.h @@ -82,6 +82,14 @@ bool pb_decode_noinit(pb_istream_t *stream, const pb_field_t fields[], void *des */ bool pb_decode_delimited(pb_istream_t *stream, const pb_field_t fields[], void *dest_struct); +#ifdef PB_ENABLE_MALLOC +/* Release any allocated pointer fields. If you use dynamic allocation, you should + * call this for any decoded message when you are done with it. You also need to + * free messages even if pb_decode() returned with error. + */ +void pb_release(const pb_field_t fields[], void *dest_struct); +#endif + /************************************** * Functions for manipulating streams * |