Commit f175c1ca authored by conrad's avatar conrad

add fisbone_clear() function, for deallocating message headers in a fisbone.

This patch can be used more generally in code using skeleton.[ch] for
avoiding memory leaks where message headers are read. Patch by ogg.k.ogg.k


git-svn-id: http://svn.annodex.net/liboggz/trunk@3603 8158c8cd-e7e1-0310-9fa4-c5954c97daef
parent a1d5f466
......@@ -214,6 +214,13 @@ int fisbone_from_ogg(ogg_packet *op, fisbone_packet *fp) {
return 0;
}
int fisbone_clear(fisbone_packet *fp)
{
if (!fp) return -1;
_ogg_free(fp->message_header_fields);
return 0;
}
int add_fishead_to_stream(ogg_stream_state *os, fishead_packet *fp) {
ogg_packet op;
......
......@@ -54,6 +54,7 @@ extern int add_message_header_field(fisbone_packet *fp, char *header_key, char *
/* remember to deallocate the returned ogg_packet properly */
extern int ogg_from_fishead(fishead_packet *fp,ogg_packet *op);
extern int ogg_from_fisbone(fisbone_packet *fp,ogg_packet *op);
extern int fisbone_clear(fisbone_packet *fp);
extern int fishead_from_ogg(ogg_packet *op,fishead_packet *fp);
extern int fisbone_from_ogg(ogg_packet *op,fisbone_packet *fp);
extern int add_fishead_to_stream(ogg_stream_state *os, fishead_packet *fp);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment