fate/imf: fix memory leak

This commit is contained in:
Pierre-Anthony Lemieux 2023-05-15 11:29:45 -07:00
parent a2a0a81184
commit dbe43bca25
No known key found for this signature in database
GPG Key ID: 698FA1F0F8D4EED4
1 changed files with 10 additions and 1 deletions

View File

@ -402,6 +402,9 @@ static int test_bad_cpl_parsing(FFIMFCPL **cpl)
return ret;
}
ff_imf_cpl_free(*cpl);
*cpl = NULL;
return 0;
}
@ -423,6 +426,9 @@ static int test_bad_resource_cpl_parsing(FFIMFCPL **cpl)
return ret;
}
ff_imf_cpl_free(*cpl);
*cpl = NULL;
return 0;
}
@ -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;