Skip to content

Commit 62f7b43

Browse files
committed
tests/api/api-dump-stream-meta-test: Fix leaks
Signed-off-by: Andreas Rheinhardt <[email protected]>
1 parent f4e72eb commit 62f7b43

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

tests/api/api-dump-stream-meta-test.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ static int dump_stream_meta(const char *input_filename) {
6767
printf("Stream ID: %d, codec name: %s, metadata: %s\n", stream_idx,
6868
avcodec_get_name(origin_par->codec_id),
6969
strlen(metadata) ? metadata : "N/A");
70+
av_free(metadata);
7071

7172
codec = avcodec_find_decoder(origin_par->codec_id);
7273
if (!codec) {
@@ -128,6 +129,7 @@ static int dump_stream_meta(const char *input_filename) {
128129

129130
printf("Stream ID: %d, new metadata: %s\n", pkt->stream_index,
130131
strlen(metadata) ? metadata : "N/A");
132+
av_free(metadata);
131133

132134
st->event_flags &= ~AVSTREAM_EVENT_FLAG_METADATA_UPDATED;
133135
}
@@ -158,6 +160,7 @@ static int dump_stream_meta(const char *input_filename) {
158160
printf("Stream ID: %d, frame PTS: %s, metadata: %s\n",
159161
pkt->stream_index, av_ts2str(fr->pts),
160162
strlen(metadata) ? metadata : "N/A");
163+
av_free(metadata);
161164
} while (1);
162165
}
163166

0 commit comments

Comments
 (0)