aboutsummaryrefslogtreecommitdiff
path: root/src/cct.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/cct.c')
-rw-r--r--src/cct.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/cct.c b/src/cct.c
index 1853a962..8096986d 100644
--- a/src/cct.c
+++ b/src/cct.c
@@ -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;
}