summaryrefslogtreecommitdiffstats
path: root/plugins/check_mysql_query.c
diff options
context:
space:
mode:
authorRincewindsHat <12514511+RincewindsHat@users.noreply.github.com>2021-12-02 15:42:05 (GMT)
committerGitHub <noreply@github.com>2021-12-02 15:42:05 (GMT)
commit911e44045d7291f5ede22739fd176ef55dd3de4a (patch)
treecf36b95a4a964b03d6ecf75770ced2cb3a2ac3a9 /plugins/check_mysql_query.c
parent8294af907bd8482a86df749f562b7ec09e3faeed (diff)
parented7cdf82a42f16532801ea4f118870ce9a130fcf (diff)
downloadmonitoring-plugins-911e44045d7291f5ede22739fd176ef55dd3de4a.tar.gz
Merge branch 'master' into fix/shellcheckrefs/pull/1459/head
Diffstat (limited to 'plugins/check_mysql_query.c')
-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 49a14dd..ac2fb15 100644
--- a/plugins/check_mysql_query.c
+++ b/plugins/check_mysql_query.c
@@ -136,18 +136,18 @@ main (int argc, char **argv)
136 die (STATE_CRITICAL, "QUERY %s: Fetch row error - %s\n", _("CRITICAL"), error); 136 die (STATE_CRITICAL, "QUERY %s: Fetch row error - %s\n", _("CRITICAL"), error);
137 } 137 }
138 138
139 /* free the result */
140 mysql_free_result (res);
141
142 /* close the connection */
143 mysql_close (&mysql);
144
145 if (! is_numeric(row[0])) { 139 if (! is_numeric(row[0])) {
146 die (STATE_CRITICAL, "QUERY %s: %s - '%s'\n", _("CRITICAL"), _("Is not a numeric"), row[0]); 140 die (STATE_CRITICAL, "QUERY %s: %s - '%s'\n", _("CRITICAL"), _("Is not a numeric"), row[0]);
147 } 141 }
148 142
149 value = strtod(row[0], NULL); 143 value = strtod(row[0], NULL);
150 144
145 /* free the result */
146 mysql_free_result (res);
147
148 /* close the connection */
149 mysql_close (&mysql);
150
151 if (verbose >= 3) 151 if (verbose >= 3)
152 printf("mysql result: %f\n", value); 152 printf("mysql result: %f\n", value);
153 153