summaryrefslogtreecommitdiffstats
path: root/plugins/check_ldap.c
diff options
context:
space:
mode:
authorAnders Kaseorg <andersk@mit.edu>2012-06-29 04:57:48 (GMT)
committerHolger Weiss <holger@zedat.fu-berlin.de>2012-06-29 11:39:11 (GMT)
commit028d50d6f99e647a325a0a68303016382c4bbdc9 (patch)
tree1d9a14635602169d137409becfa108cd6bdb371c /plugins/check_ldap.c
parent9976876584e5a1df6e1c9315212c3d274df7a12e (diff)
downloadmonitoring-plugins-028d50d6f99e647a325a0a68303016382c4bbdc9.tar.gz
Die when asprintf fails
Fixes many instances of warning: ignoring return value of 'asprintf', declared with attribute warn_unused_result [-Wunused-result] Signed-off-by: Anders Kaseorg <andersk@mit.edu>
Diffstat (limited to 'plugins/check_ldap.c')
-rw-r--r--plugins/check_ldap.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/plugins/check_ldap.c b/plugins/check_ldap.c
index f83f139..65db851 100644
--- a/plugins/check_ldap.c
+++ b/plugins/check_ldap.c
@@ -99,7 +99,7 @@ main (int argc, char *argv[])
99 textdomain (PACKAGE); 99 textdomain (PACKAGE);
100 100
101 if (strstr(argv[0],"check_ldaps")) { 101 if (strstr(argv[0],"check_ldaps")) {
102 asprintf (&progname, "check_ldaps"); 102 xasprintf (&progname, "check_ldaps");
103 } 103 }
104 104
105 /* Parse extra opts if any */ 105 /* Parse extra opts if any */
@@ -145,7 +145,7 @@ main (int argc, char *argv[])
145#endif 145#endif
146 146
147 if (ld_port == LDAPS_PORT || ssl_on_connect) { 147 if (ld_port == LDAPS_PORT || ssl_on_connect) {
148 asprintf (&SERVICE, "LDAPS"); 148 xasprintf (&SERVICE, "LDAPS");
149#if defined(HAVE_LDAP_SET_OPTION) && defined(LDAP_OPT_X_TLS) 149#if defined(HAVE_LDAP_SET_OPTION) && defined(LDAP_OPT_X_TLS)
150 /* ldaps: set option tls */ 150 /* ldaps: set option tls */
151 tls = LDAP_OPT_X_TLS_HARD; 151 tls = LDAP_OPT_X_TLS_HARD;
@@ -162,7 +162,7 @@ main (int argc, char *argv[])
162 return STATE_CRITICAL; 162 return STATE_CRITICAL;
163#endif /* LDAP_OPT_X_TLS */ 163#endif /* LDAP_OPT_X_TLS */
164 } else if (starttls) { 164 } else if (starttls) {
165 asprintf (&SERVICE, "LDAP-TLS"); 165 xasprintf (&SERVICE, "LDAP-TLS");
166#if defined(HAVE_LDAP_SET_OPTION) && defined(HAVE_LDAP_START_TLS_S) 166#if defined(HAVE_LDAP_SET_OPTION) && defined(HAVE_LDAP_START_TLS_S)
167 /* ldap with startTLS: set option version */ 167 /* ldap with startTLS: set option version */
168 if (ldap_get_option(ld,LDAP_OPT_PROTOCOL_VERSION, &version) == LDAP_OPT_SUCCESS ) 168 if (ldap_get_option(ld,LDAP_OPT_PROTOCOL_VERSION, &version) == LDAP_OPT_SUCCESS )
@@ -389,7 +389,7 @@ void
389print_help (void) 389print_help (void)
390{ 390{
391 char *myport; 391 char *myport;
392 asprintf (&myport, "%d", DEFAULT_PORT); 392 xasprintf (&myport, "%d", DEFAULT_PORT);
393 393
394 print_revision (progname, NP_VERSION); 394 print_revision (progname, NP_VERSION);
395 395