Skip to content

Commit

Permalink
fate/imf: fix memory leak
Browse files Browse the repository at this point in the history
  • Loading branch information
palemieux committed May 18, 2023
1 parent a2a0a81 commit dbe43bc
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion libavformat/tests/imf.c
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,9 @@ static int test_bad_cpl_parsing(FFIMFCPL **cpl)
return ret;
}

ff_imf_cpl_free(*cpl);
*cpl = NULL;

return 0;
}

Expand All @@ -423,6 +426,9 @@ static int test_bad_resource_cpl_parsing(FFIMFCPL **cpl)
return ret;
}

ff_imf_cpl_free(*cpl);
*cpl = NULL;

return 0;
}

Expand Down Expand Up @@ -594,8 +600,11 @@ int main(int argc, char *argv[])
printf("#### End failing test ####\n");

printf("#### The following should emit errors ####\n");
if (test_bad_resource_cpl_parsing(&cpl) != 0)
if (test_bad_resource_cpl_parsing(&cpl) != 0) {
if (cpl)
printf("Improper cleanup after failed CPL parsing\n");
ret = 1;
}
printf("#### End emission of errors ####\n");

return ret;
Expand Down

0 comments on commit dbe43bc

Please sign in to comment.