aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Sven Nierlein <sven@nierlein.de> 2021-04-07 09:25:15 +0200
committerGravatar GitHub <noreply@github.com> 2021-04-07 09:25:15 +0200
commitb820725ee18608de9c0c157f83ef160659b35207 (patch)
tree22f0e2d1d135ed7d74c1c7ee27a80baf8455328b
parent57b4dc0f2307cd49bedeed01ee56bc6077d428f5 (diff)
parentb8b87b55d61aceff03107b0335347257f429e9ad (diff)
downloadmonitoring-plugins-b820725ee18608de9c0c157f83ef160659b35207.tar.gz
Merge pull request #1644 from ghciv6/check_mysql_query_1562
- fix for issue #1562
-rw-r--r--plugins/check_mysql_query.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/plugins/check_mysql_query.c b/plugins/check_mysql_query.c
index 49a14dd3..ac2fb15d 100644
--- a/plugins/check_mysql_query.c
+++ b/plugins/check_mysql_query.c
@@ -136,18 +136,18 @@ main (int argc, char **argv)
die (STATE_CRITICAL, "QUERY %s: Fetch row error - %s\n", _("CRITICAL"), error);
}
- /* free the result */
- mysql_free_result (res);
-
- /* close the connection */
- mysql_close (&mysql);
-
if (! is_numeric(row[0])) {
die (STATE_CRITICAL, "QUERY %s: %s - '%s'\n", _("CRITICAL"), _("Is not a numeric"), row[0]);
}
value = strtod(row[0], NULL);
+ /* free the result */
+ mysql_free_result (res);
+
+ /* close the connection */
+ mysql_close (&mysql);
+
if (verbose >= 3)
printf("mysql result: %f\n", value);