diff options
author | mannol <eniz_vukovic@hotmail.com> | 2014-05-31 00:29:43 +0200 |
---|---|---|
committer | mannol <eniz_vukovic@hotmail.com> | 2014-05-31 00:29:43 +0200 |
commit | 2ebefb85b7f5ae28db1e8c11196467efd3c914cf (patch) | |
tree | c062506bfc8e5e7ba779d30ece29d6e7f4c05e57 /toxav/media.c | |
parent | e0ed51b2dc8cf9d14c5978f717bacef001df3aa4 (diff) |
Fixed potential memleaks
Diffstat (limited to 'toxav/media.c')
-rw-r--r-- | toxav/media.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/toxav/media.c b/toxav/media.c index 16156d9d..8b50e301 100644 --- a/toxav/media.c +++ b/toxav/media.c | |||
@@ -59,7 +59,10 @@ JitterBuffer *create_queue(int capacity) | |||
59 | 59 | ||
60 | if ( !(q = calloc(sizeof(JitterBuffer), 1)) ) return NULL; | 60 | if ( !(q = calloc(sizeof(JitterBuffer), 1)) ) return NULL; |
61 | 61 | ||
62 | if (!(q->queue = calloc(sizeof(RTPMessage *), capacity))) return NULL; | 62 | if (!(q->queue = calloc(sizeof(RTPMessage *), capacity))) { |
63 | free(q); | ||
64 | return NULL; | ||
65 | } | ||
63 | 66 | ||
64 | q->size = 0; | 67 | q->size = 0; |
65 | q->capacity = capacity; | 68 | q->capacity = capacity; |