summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: bb12487)
raw | patch | inline | side by side (parent: bb12487)
author | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Fri, 22 Oct 2010 21:02:20 +0000 (21:02 +0000) | ||
committer | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Fri, 22 Oct 2010 21:02:20 +0000 (21:02 +0000) |
src/rrd_daemon.c | patch | blob | history |
diff --git a/src/rrd_daemon.c b/src/rrd_daemon.c
index 90629271e3478f1c7f4a9620e918c7d60b0373e3..0dc8e0b33f28c7f38be82cc513e727b26b92366e 100644 (file)
--- a/src/rrd_daemon.c
+++ b/src/rrd_daemon.c
{
char *file, file_tmp[PATH_MAX];
int status;
- rrd_info_t *data;
+ rrd_info_t *info;
/* obtain filename */
status = buffer_get_field(&buffer, &buffer_size, &file);
}
/* get data */
rrd_clear_error ();
- data = rrd_info_r(file);
- if(!data) {
+ info = rrd_info_r(file);
+ if(!info) {
return send_response(sock, RESP_ERR, "RRD Error: %s\n", rrd_get_error());
}
- while (data) {
+ for (rrd_info_t *data = info; data != NULL; data = data->next) {
switch (data->type) {
case RD_I_VAL:
if (isnan(data->value.u_val))
add_response_info(sock,"%s %d %lu\n", data->key, data->type, data->value.u_blo.size);
break;
}
- data = data->next;
}
+
+ rrd_info_free(info);
+
return send_response(sock, RESP_OK, "Info for %s follows\n",file);
} /* }}} static int handle_request_info */