Skip to content

Commit

Permalink
Fix a potential bug by checking that a buffer is not zero before atte…
Browse files Browse the repository at this point in the history
…mpting to deallocate it.
  • Loading branch information
mikebrady committed Dec 4, 2024
1 parent a4ca4b6 commit e4d3c6f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion rtsp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1439,7 +1439,10 @@ enum rtsp_read_request_response rtsp_read_request(rtsp_conn_info *conn, rtsp_mes
*the_packet = msg;
shutdown:
if (reply != rtsp_read_request_response_ok) {
msg_free(the_packet);
if (*the_packet != NULL) {
debug(3, "Freeing the_packet");
msg_free(the_packet);
}
release_buffer = 1; // allow the buffer to be released
}
pthread_cleanup_pop(release_buffer);
Expand Down

0 comments on commit e4d3c6f

Please sign in to comment.