Set pointer to NULL when freeing to fix issue.

This commit is contained in:
irungentoo 2014-08-04 12:40:18 -04:00
parent 9445b40fb5
commit d4218dcd61
No known key found for this signature in database
GPG Key ID: 10349DC9BED89E98

View File

@ -569,6 +569,7 @@ int toxav_kill_transmission ( ToxAv *av, int32_t call_index )
for (i = 0; i != VIDEO_DECODE_QUEUE_SIZE; i++) {
p = call->video_decode_queue[i];
call->video_decode_queue[i] = NULL;
if (p) {
free(p);
@ -577,6 +578,7 @@ int toxav_kill_transmission ( ToxAv *av, int32_t call_index )
for (i = 0; i != AUDIO_DECODE_QUEUE_SIZE; i++) {
p = call->audio_decode_queue[i];
call->audio_decode_queue[i] = NULL;
if (p) {
free(p);