Skip to content

Commit

Permalink
pjmedia_wav_player_port_create() fix
Browse files Browse the repository at this point in the history
Fix: If create_file_port() fails to allocate memory, the pool is destroyed twice. First time there, and second time in the on_error of the calling function (pjmedia_wav_player_port_create).
  • Loading branch information
LeonidGoltsblat committed Dec 23, 2024
1 parent e9060fb commit 343a7a1
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions pjmedia/src/pjmedia/wav_player.c
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,8 @@ static struct file_reader_port *create_file_port(pj_pool_t *pool)
struct file_reader_port *port;

port = PJ_POOL_ZALLOC_T(pool, struct file_reader_port);
if (!port) {
pj_pool_release(pool);
if (!port)
return NULL;
}

/* Put in default values.
* These will be overriden once the file is read.
Expand Down

0 comments on commit 343a7a1

Please sign in to comment.