diff --git a/libavformat/avienc.c b/libavformat/avienc.c index 0e55953850..3fd98692ab 100644 --- a/libavformat/avienc.c +++ b/libavformat/avienc.c @@ -586,8 +586,7 @@ static int avi_write_trailer(AVFormatContext *s) for (i=0; iindexes[i].ents_allocated/AVI_INDEX_CLUSTER_SIZE; j++) av_free(avi->indexes[i].cluster[j]); - av_free(avi->indexes[i].cluster); - avi->indexes[i].cluster = NULL; + av_freep(&avi->indexes[i].cluster); avi->indexes[i].ents_allocated = avi->indexes[i].entry = 0; }