diff options
| author | Kristian Evers <kristianevers@gmail.com> | 2018-03-15 08:29:49 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-03-15 08:29:49 +0100 |
| commit | 16618bf5763aa235e01755d4865b455ccb14c928 (patch) | |
| tree | 41c5920fd36155375648dff8fd96d197308091f3 /src/cct.c | |
| parent | 30090445886a8f6842028b5ab20601f4c7336fe2 (diff) | |
| parent | 3cc7b4c62382650f9bf00365b25f8fa7f6eed603 (diff) | |
| download | PROJ-16618bf5763aa235e01755d4865b455ccb14c928.tar.gz PROJ-16618bf5763aa235e01755d4865b455ccb14c928.zip | |
Merge pull request #860 from rouault/cppcheck
Fix various issues spotted by cppcheck and clang static analyzer
Diffstat (limited to 'src/cct.c')
| -rw-r--r-- | src/cct.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -202,6 +202,7 @@ int main(int argc, char **argv) { } if (opt_given (o, "c")) { + /* cppcheck-suppress invalidscanf */ int ncols = sscanf (opt_arg (o, "c"), "%d,%d,%d,%d", columns_xyzt, columns_xyzt+1, columns_xyzt+2, columns_xyzt+3); if (ncols != nfields) { fprintf (stderr, "%s: Too few input columns given: '%s'\n", o->progname, opt_arg (o, "c")); @@ -232,6 +233,8 @@ int main(int argc, char **argv) { /* fail if an inverse operation is not available */ if (!proj_pj_info(P).has_inverse) { fprintf (stderr, "Inverse operation not available\n"); + if (stdout != fout) + fclose (fout); return 1; } /* We have no API call for inverting an operation, so we brute force it. */ @@ -306,6 +309,7 @@ int main(int argc, char **argv) { if (stdout != fout) fclose (fout); free (o); + free (buf); return 0; } |
