Merge pull request #8119 from donaldsharp/clippy_mem_leak

lib: Free memory leak in error path in clippy
This commit is contained in:
David Lamparter 2021-02-22 06:41:23 +01:00 committed by GitHub
commit 3e62a52bb2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -68,6 +68,8 @@ int main(int argc, char **argv)
fp = fopen(pyfile, "r");
if (!fp) {
fprintf(stderr, "%s: %s\n", pyfile, strerror(errno));
free(name);
return 1;
}
} else {
@ -86,6 +88,8 @@ int main(int argc, char **argv)
if (PyRun_AnyFile(fp, pyfile)) {
if (PyErr_Occurred())
PyErr_Print();
free(name);
return 1;
}
Py_Finalize();