History

fate/imf: fix memory leak

Pierre-Anthony Lemieux committed 3 years ago

Commit dbe43bc1 parent a2a0a811 file · +10 −1Browse files

Unified · Split

libavformat/tests/imf.c+10−1
@@ -402,6 +402,9 @@ static int test_bad_cpl_parsing(FFIMFCPL **cpl) · 401 unmodified lines
402402 return ret;
403403 }
404404
405+ ff_imf_cpl_free(*cpl);
406+ *cpl = NULL;
407+
405408 return 0;
406409 }
407410
@@ -423,6 +426,9 @@ static int test_bad_resource_cpl_parsing(FFIMFCPL **cpl) · 15 unmodified lines
423426 return ret;
424427 }
425428
429+ ff_imf_cpl_free(*cpl);
430+ *cpl = NULL;
431+
426432 return 0;
427433 }
428434
@@ -594,8 +600,11 @@ int main(int argc, char *argv[]) · 165 unmodified lines
594600 printf("#### End failing test ####\n");
595601
596602 printf("#### The following should emit errors ####\n");
597− if (test_bad_resource_cpl_parsing(&cpl) != 0)
603+ if (test_bad_resource_cpl_parsing(&cpl) != 0) {
604+ if (cpl)
605+ printf("Improper cleanup after failed CPL parsing\n");
598606 ret = 1;
607+ }
599608 printf("#### End emission of errors ####\n");
600609
601610 return ret;

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