Skip to content
Snippets Groups Projects
Commit e6ec74c8 authored by Jan Včelák's avatar Jan Včelák :rocket:
Browse files

dnstap reader: add API to free the frame

parent dd2e64dc
No related branches found
No related tags found
No related merge requests found
......@@ -92,3 +92,13 @@ int dt_reader_read(dt_reader_t *reader, Dnstap__Dnstap **d)
return KNOT_EOK;
}
void dt_reader_free_frame(dt_reader_t *reader, Dnstap__Dnstap **frame_ptr)
{
if (!*frame_ptr) {
return;
}
dnstap__dnstap__free_unpacked(*frame_ptr, NULL);
*frame_ptr = NULL;
}
......@@ -72,6 +72,14 @@ int dt_reader_free(dt_reader_t *reader);
*/
int dt_reader_read(dt_reader_t *reader, Dnstap__Dnstap **d);
/*!
* \brief free the frame allocated by dt_read_data.
*
* \param reader Dnstap reader context.
* \param d The frame to be freed.
*/
void dt_reader_free_frame(dt_reader_t *reader, Dnstap__Dnstap **d);
#endif // _DNSTAP__DNSTAP_H_
/*! @} */
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment