fi
AC_MSG_CHECKING([for libjvm.so])
- TMPVAR=`find -L "$with_java_home" -name libjvm.so -type f -exec 'dirname' '{}' ';' 2>/dev/null | head -n 1`
+ TMPVAR=`find -L "$with_java_home" -type f -name libjvm.so -o -name libjvm.dylib -exec 'dirname' '{}' ';' 2>/dev/null | head -n 1`
if test "x$TMPVAR" != "x"
then
AC_MSG_RESULT([found in $TMPVAR])
inst->state_ ## field = malloc (sizeof (*inst->state_ ## field)); \
if (inst->state_ ## field == NULL) { \
agg_instance_destroy (inst); \
+ free (inst); \
ERROR ("aggregation plugin: malloc() failed."); \
return (NULL); \
} \
return (-1);
}
+ sfree (url);
url = strdup (child->values[0].value.string);
} else if (strcasecmp ("OpCodes", child->key) == 0)
bind_config_set_bool ("OpCodes", &global_opcodes, child);
sstrncpy (xpath->values[i].path, ci->values[i].value.string, sizeof (xpath->values[i].path));
}
- return (0);
+ return (0);
} /* }}} cx_config_add_values */
static int cx_config_add_xpath (cx_t *db, /* {{{ */
{
ERROR ("curl_xml plugin: invalid xpath. "
"xpath value can't be an empty string");
+ sfree (xpath);
return (-1);
}
if (db->list == NULL)
{
ERROR ("curl_xml plugin: list creation failed.");
+ sfree (xpath->path);
+ sfree (xpath);
return (-1);
}
}
if (name == NULL)
{
ERROR ("curl_xml plugin: strdup failed.");
+ sfree (xpath->path);
+ sfree (xpath);
return (-1);
}
if (le == NULL)
{
ERROR ("curl_xml plugin: llentry_create failed.");
+ sfree (xpath->path);
+ sfree (xpath);
return (-1);
}
/ CDTIME_T_TO_DOUBLE (vl->interval);
ce->values_raw[i].absolute = vl->values[i].absolute;
break;
-
+
default:
/* This shouldn't happen. */
ERROR ("uc_insert: Don't know how to handle data source type %i.",
ds->ds[i].type);
sfree (key_copy);
+ cache_free (ce);
return (-1);
} /* switch (ds->ds[i].type) */
} /* for (i) */
if (status != 0)
{
lcc_set_errno (c, status);
+ freeaddrinfo (ai_res);
return (-1);
}
+ freeaddrinfo (ai_res);
return (0);
} /* }}} int lcc_open_netsocket */
if (dev[0] == '.')
return 0;
-
+
ssnprintf (buf, sizeof (buf), "/sys/class/net/%s/device/driver", dev);
- buf[sizeof (buf) - 1] = 0;
+ buf[sizeof (buf) - 1] = '\0';
- memset (buf2, 0, sizeof (buf2));
i = readlink (buf, buf2, sizeof (buf2) - 1);
if (i < 0)
return 0;
+ buf2[i] = '\0';
+
if (strstr (buf2, "/drivers/ath_") == NULL)
return 0;
return 1;
if (tmp == NULL)
{
ERROR ("statsd plugin: realloc failed.");
+ close (fd);
continue;
}
fds = tmp;
return (-1);
}
- chmod (sa.sun_path, sock_perms);
+ status = chmod (sa.sun_path, sock_perms);
+ if (status == -1)
+ {
+ char errbuf[1024];
+ ERROR ("unixsock plugin: chmod failed: %s",
+ sstrerror (errno, errbuf, sizeof (errbuf)));
+ close (sock_fd);
+ sock_fd = -1;
+ return (-1);
+ }
status = listen (sock_fd, 8);
if (status != 0)
{
WARNING ("Varnish plugin: \"Instance\" blocks accept only "
"one argument.");
+ sfree (conf);
return (EINVAL);
}
WARNING ("Varnish plugin: No metric has been configured for "
"instance \"%s\". Disabling this instance.",
(conf->instance == NULL) ? "localhost" : conf->instance);
+ sfree (conf);
return (EINVAL);
}
}
if ((val = strdup(child->values[1].value.string)) == NULL) {
WARNING("cannot allocate memory for attribute value.");
+ sfree (key);
return (-1);
}
strarray_add(&riemann_attrs, &riemann_attrs_num, key);
char *handlers_str = build_json_str_list("handlers", &(host->notification_handlers));
if (handlers_str == NULL) {
ERROR("write_sensu plugin: Unable to alloc memory");
+ free(ret_str);
return NULL;
}
// incorporate the handlers
char *msg = replace_json_reserved(n->message);
if (msg == NULL) {
ERROR("write_sensu plugin: Unable to alloc memory");
+ free(ret_str);
return NULL;
}
res = asprintf(&temp_str, "%s, \"output\": \"%s - %s\"", ret_str, severity, msg);
ERROR("write_tsdb plugin: Connecting to %s:%s failed. "
"The last error was: %s", node, service,
sstrerror (errno, errbuf, sizeof(errbuf)));
- close(cb->sock_fd);
return -1;
}
{
llentry_t *e;
llvalues = malloc(sizeof(long long int) * i);
+ if (llvalues == NULL)
+ {
+ ERROR ("zfs_arc plugin: `malloc' failed.");
+ return (-1);
+ }
int j = 0;
pnl = file_contents;
}
buffer_fill += (size_t) status;
- if (status == 0)
- {
- /* done reading from the socket */
- break;
- }
} /* while (recv) */
status = 0;