aboutsummaryrefslogtreecommitdiff
path: root/plugins/check_ldap.c
diff options
context:
space:
mode:
authorGravatar Anders Kaseorg <andersk@mit.edu> 2012-06-29 00:57:48 -0400
committerGravatar Holger Weiss <holger@zedat.fu-berlin.de> 2012-06-29 13:39:11 +0200
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 f83f1397..65db8517 100644
--- a/plugins/check_ldap.c
+++ b/plugins/check_ldap.c
@@ -99,7 +99,7 @@ main (int argc, char *argv[])
textdomain (PACKAGE);
if (strstr(argv[0],"check_ldaps")) {
- asprintf (&progname, "check_ldaps");
+ xasprintf (&progname, "check_ldaps");
}
/* Parse extra opts if any */
@@ -145,7 +145,7 @@ main (int argc, char *argv[])
#endif
if (ld_port == LDAPS_PORT || ssl_on_connect) {
- asprintf (&SERVICE, "LDAPS");
+ xasprintf (&SERVICE, "LDAPS");
#if defined(HAVE_LDAP_SET_OPTION) && defined(LDAP_OPT_X_TLS)
/* ldaps: set option tls */
tls = LDAP_OPT_X_TLS_HARD;
@@ -162,7 +162,7 @@ main (int argc, char *argv[])
return STATE_CRITICAL;
#endif /* LDAP_OPT_X_TLS */
} else if (starttls) {
- asprintf (&SERVICE, "LDAP-TLS");
+ xasprintf (&SERVICE, "LDAP-TLS");
#if defined(HAVE_LDAP_SET_OPTION) && defined(HAVE_LDAP_START_TLS_S)
/* ldap with startTLS: set option version */
if (ldap_get_option(ld,LDAP_OPT_PROTOCOL_VERSION, &version) == LDAP_OPT_SUCCESS )
@@ -389,7 +389,7 @@ void
print_help (void)
{
char *myport;
- asprintf (&myport, "%d", DEFAULT_PORT);
+ xasprintf (&myport, "%d", DEFAULT_PORT);
print_revision (progname, NP_VERSION);