diff options
| author | Donald Sharp <sharpd@nvidia.com> | 2021-02-20 07:38:06 -0500 |
|---|---|---|
| committer | Donald Sharp <sharpd@nvidia.com> | 2021-02-20 07:40:01 -0500 |
| commit | f52aee04b3839b5c2bcfb2a5114b698e39925df2 (patch) | |
| tree | 93528d7fa4c9de298186a852c258d122ceb429b6 /lib/clippy.c | |
| parent | 1c0f3e760a43000880897e05b904e4bf0c117e76 (diff) | |
lib: Free memory leak in error path in clippy
When running clippy, the main function in it's
error path could leak the memory pointed to by name.
Fix this. This was/is reported by clang SA.
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Diffstat (limited to 'lib/clippy.c')
| -rw-r--r-- | lib/clippy.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/clippy.c b/lib/clippy.c index b52c48ec92..6223697ae9 100644 --- a/lib/clippy.c +++ b/lib/clippy.c @@ -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(); |
