set sb_data to NULL when the memory is released. Fixes segfault when streaming over rtsp/http
This commit is contained in:
parent
2c00a4da4f
commit
5c803bcdf0
1 changed files with 3 additions and 1 deletions
|
@ -231,8 +231,10 @@ put_utf8(char *out, int c)
|
|||
void
|
||||
sbuf_free(sbuf_t *sb)
|
||||
{
|
||||
free(sb->sb_data);
|
||||
if(sb->sb_data)
|
||||
free(sb->sb_data);
|
||||
sb->sb_size = sb->sb_ptr = sb->sb_err = 0;
|
||||
sb->sb_data = NULL;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
Loading…
Add table
Reference in a new issue