summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzoff99 <zoff@zoff.cc>2020-04-05 09:25:50 +0200
committeriphydf <iphydf@users.noreply.github.com>2020-04-05 09:32:23 +0000
commitbcbc37437086b4814a451382a4342f1b6a75cbd1 (patch)
tree4a674dcf6c9f90feb4d9df4f890c97e047aee93a
parentf0ae0511c21b43d7531885a2be8fc0710e1732f0 (diff)
Fix 2 memory leaks in ToxAV.
-rw-r--r--toxav/audio.c4
-rw-r--r--toxav/video.c4
2 files changed, 8 insertions, 0 deletions
diff --git a/toxav/audio.c b/toxav/audio.c
index da1ea11f..cf9097d7 100644
--- a/toxav/audio.c
+++ b/toxav/audio.c
@@ -204,6 +204,10 @@ void ac_iterate(ACSession *ac)
204int ac_queue_message(Mono_Time *mono_time, void *acp, struct RTPMessage *msg) 204int ac_queue_message(Mono_Time *mono_time, void *acp, struct RTPMessage *msg)
205{ 205{
206 if (!acp || !msg) { 206 if (!acp || !msg) {
207 if (msg) {
208 free(msg);
209 }
210
207 return -1; 211 return -1;
208 } 212 }
209 213
diff --git a/toxav/video.c b/toxav/video.c
index 7855f142..3d3714eb 100644
--- a/toxav/video.c
+++ b/toxav/video.c
@@ -351,6 +351,10 @@ int vc_queue_message(Mono_Time *mono_time, void *vcp, struct RTPMessage *msg)
351 * this function gets called from handle_rtp_packet() and handle_rtp_packet_v3() 351 * this function gets called from handle_rtp_packet() and handle_rtp_packet_v3()
352 */ 352 */
353 if (!vcp || !msg) { 353 if (!vcp || !msg) {
354 if (msg) {
355 free(msg);
356 }
357
354 return -1; 358 return -1;
355 } 359 }
356 360