diff options
author | Alexander Köplinger <alex.koeplinger@outlook.com> | 2017-01-23 05:11:40 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-01-23 05:11:40 +0300 |
commit | 5a28370d8a8945877e7537762770d1119c34bf9f (patch) | |
tree | 0dfcb3432490fb90b0f7c80c4f2c7dc11b644fc4 /scripts/launch.c | |
parent | 5c62590ba739d5960019890fe458e9b326b51993 (diff) |
Fix a few cppcheck errors (#4281)
* [zlib] Fix CppCheck error "Shifting a negative value is undefined behaviour"
This matches what upstream now does:
https://github.com/madler/zlib/blob/2edb94a3025d288dc251bc6cbb2c02e60fbd7438/inflate.c#L1529
* [scripts] Fix CppCheck error "Memory leak: nargv"
* [tests] Fix CppCheck error: "Memory leak: reference"
* [aot-compiler] Fix CppCheck error: "Resource leak: infile"
* [metadata] Fix CppCheck error: "Uninitialized variable: ret"
Diffstat (limited to 'scripts/launch.c')
-rw-r--r-- | scripts/launch.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/scripts/launch.c b/scripts/launch.c index 856f12335b3..4a1bd46b747 100644 --- a/scripts/launch.c +++ b/scripts/launch.c @@ -15,12 +15,14 @@ main (int argc, char *argv []) if (last == NULL){ fprintf (stderr, "Do not know how to invoke the program given [%s]\n", argv [0]); + free (nargv); return 1; } len = strlen (last) + strlen (PROFILE_BASE_DIR) + 1; command = malloc (len); if (command == NULL){ fprintf (stderr, "Error allocating memory"); + free (nargv); return 1; } strcpy (command, PROFILE_BASE_DIR); |