summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Baumann <mail@andreasbaumann.cc>2018-05-31 14:43:02 +0200
committerAndreas Baumann <mail@andreasbaumann.cc>2018-05-31 14:43:02 +0200
commiteacaad30433607fbdcf742aad4ff51aad5ddf749 (patch)
tree127c53896130afd79b06cfcd8c58e280b20f3fbb
parentedbae53933c99a468aae25e1bf74f91c232f47e0 (diff)
downloadmonitoring-plugins-eacaad3.tar.gz
fixed initialization of server_url (freeing non-pointer in case of redirects)
-rw-r--r--plugins/check_curl.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/plugins/check_curl.c b/plugins/check_curl.c
index 9e13766a..73b3aad0 100644
--- a/plugins/check_curl.c
+++ b/plugins/check_curl.c
@@ -129,7 +129,7 @@ int invert_regex = 0;
129 129
130char *server_address; 130char *server_address;
131char *host_name; 131char *host_name;
132char *server_url = DEFAULT_SERVER_URL; 132char *server_url = 0;
133char server_ip[DEFAULT_BUFFER_SIZE]; 133char server_ip[DEFAULT_BUFFER_SIZE];
134struct curl_slist *server_ips = NULL; 134struct curl_slist *server_ips = NULL;
135unsigned short server_port = HTTP_PORT; 135unsigned short server_port = HTTP_PORT;
@@ -1160,6 +1160,8 @@ process_arguments (int argc, char **argv)
1160 strcpy (argv[c], "-n"); 1160 strcpy (argv[c], "-n");
1161 } 1161 }
1162 1162
1163 server_url = strdup(DEFAULT_SERVER_URL);
1164
1163 while (1) { 1165 while (1) {
1164 c = getopt_long (argc, argv, "Vvh46t:c:w:A:k:H:P:j:T:I:a:b:d:e:p:s:R:r:u:f:C:J:K:nlLS::m:M:NE", longopts, &option); 1166 c = getopt_long (argc, argv, "Vvh46t:c:w:A:k:H:P:j:T:I:a:b:d:e:p:s:R:r:u:f:C:J:K:nlLS::m:M:NE", longopts, &option);
1165 if (c == -1 || c == EOF || c == 1) 1167 if (c == -1 || c == EOF || c == 1)