History

tests/api/api-dump-stream-meta-test: Fix leaks

Andreas Rheinhardt committed 1 year ago

Commit 62f7b431 parent f4e72eb1 file · +3 −0Browse files

Unified · Split

tests/api/api-dump-stream-meta-test.c+3−0
@@ -67,6 +67,7 @@ static int dump_stream_meta(const char *input_filename) { · 66 unmodified lines
67 printf("Stream ID: %d, codec name: %s, metadata: %s\n", stream_idx,67 printf("Stream ID: %d, codec name: %s, metadata: %s\n", stream_idx,
68 avcodec_get_name(origin_par->codec_id),68 avcodec_get_name(origin_par->codec_id),
69 strlen(metadata) ? metadata : "N/A");69 strlen(metadata) ? metadata : "N/A");
70 av_free(metadata);
70 71
71 codec = avcodec_find_decoder(origin_par->codec_id);72 codec = avcodec_find_decoder(origin_par->codec_id);
72 if (!codec) {73 if (!codec) {
@@ -128,6 +129,7 @@ static int dump_stream_meta(const char *input_filename) { · 55 unmodified lines
128 129
129 printf("Stream ID: %d, new metadata: %s\n", pkt->stream_index,130 printf("Stream ID: %d, new metadata: %s\n", pkt->stream_index,
130 strlen(metadata) ? metadata : "N/A");131 strlen(metadata) ? metadata : "N/A");
132 av_free(metadata);
131 133
132 st->event_flags &= ~AVSTREAM_EVENT_FLAG_METADATA_UPDATED;134 st->event_flags &= ~AVSTREAM_EVENT_FLAG_METADATA_UPDATED;
133 }135 }
@@ -158,6 +160,7 @@ static int dump_stream_meta(const char *input_filename) { · 24 unmodified lines
158 printf("Stream ID: %d, frame PTS: %s, metadata: %s\n",160 printf("Stream ID: %d, frame PTS: %s, metadata: %s\n",
159 pkt->stream_index, av_ts2str(fr->pts),161 pkt->stream_index, av_ts2str(fr->pts),
160 strlen(metadata) ? metadata : "N/A");162 strlen(metadata) ? metadata : "N/A");
163 av_free(metadata);
161 } while (1);164 } while (1);
162 }165 }
163 166

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t