aboutsummaryrefslogtreecommitdiffstats
path: root/libavdevice/v4l2.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-12-12 14:46:46 +0100
committerMichael Niedermayer <michaelni@gmx.at>2014-12-12 14:46:46 +0100
commiteb725235b03fbaffd670409f12f3f9a71dd12cfd (patch)
tree8cc2aca03a9b31557336a0786688dce900782643 /libavdevice/v4l2.c
parent30d2ac4bf9b995bd9ab00e3a7277f4207be676e8 (diff)
downloadffmpeg-eb725235b03fbaffd670409f12f3f9a71dd12cfd.tar.gz
avdevice/v4l2: use av_freep() to avoid leaving stale pointers in memory
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavdevice/v4l2.c')
-rw-r--r--libavdevice/v4l2.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/libavdevice/v4l2.c b/libavdevice/v4l2.c
index 8695645452..29699808d5 100644
--- a/libavdevice/v4l2.c
+++ b/libavdevice/v4l2.c
@@ -356,7 +356,7 @@ static int mmap_init(AVFormatContext *ctx)
s->buf_len = av_malloc_array(s->buffers, sizeof(unsigned int));
if (!s->buf_len) {
av_log(ctx, AV_LOG_ERROR, "Cannot allocate buffer sizes\n");
- av_free(s->buf_start);
+ av_freep(&s->buf_start);
return AVERROR(ENOMEM);
}
@@ -634,8 +634,8 @@ static void mmap_close(struct video_data *s)
for (i = 0; i < s->buffers; i++) {
v4l2_munmap(s->buf_start[i], s->buf_len[i]);
}
- av_free(s->buf_start);
- av_free(s->buf_len);
+ av_freep(&s->buf_start);
+ av_freep(&s->buf_len);
}
static int v4l2_set_parameters(AVFormatContext *ctx)