157 lines
5.2 KiB
Diff
157 lines
5.2 KiB
Diff
Index: program/src/rrd_update.c
|
|
===================================================================
|
|
--- program/src/rrd_update.c (revision 1228)
|
|
+++ program/src/rrd_update.c (revision 1277)
|
|
@@ -1964,5 +1964,5 @@
|
|
rrd_file->pos, rrd->rra_def[rra_idx].cf_nam);
|
|
#endif
|
|
- if (pcdp_summary != NULL) {
|
|
+ if (*pcdp_summary != NULL) {
|
|
iv.u_val = rrd->cdp_prep[cdp_idx].scratch[CDP_scratch_idx].u_val;
|
|
/* append info to the return hash */
|
|
Index: program/src/rrd_create.c
|
|
===================================================================
|
|
--- program/src/rrd_create.c (revision 1271)
|
|
+++ program/src/rrd_create.c (revision 1278)
|
|
@@ -122,5 +122,5 @@
|
|
if ((rrd.stat_head = calloc(1, sizeof(stat_head_t))) == NULL) {
|
|
rrd_set_error("allocating rrd.stat_head");
|
|
- rrd_free(&rrd);
|
|
+ free(rrd.stat_head);
|
|
return (-1);
|
|
}
|
|
@@ -129,5 +129,6 @@
|
|
if ((rrd.live_head = calloc(1, sizeof(live_head_t))) == NULL) {
|
|
rrd_set_error("allocating rrd.live_head");
|
|
- rrd_free(&rrd);
|
|
+ free(rrd.stat_head);
|
|
+ free(rrd.live_head);
|
|
return (-1);
|
|
}
|
|
@@ -162,5 +163,6 @@
|
|
NULL) {
|
|
rrd_set_error("allocating rrd.ds_def");
|
|
- rrd_free(&rrd);
|
|
+ free(rrd.stat_head);
|
|
+ free(rrd.live_head);
|
|
return (-1);
|
|
}
|
|
@@ -194,5 +196,6 @@
|
|
}
|
|
if (rrd_test_error()) {
|
|
- rrd_free(&rrd);
|
|
+ free(rrd.stat_head);
|
|
+ free(rrd.live_head);
|
|
return -1;
|
|
}
|
|
@@ -217,5 +220,6 @@
|
|
|
|
if (rrd_test_error()) {
|
|
- rrd_free(&rrd);
|
|
+ free(rrd.stat_head);
|
|
+ free(rrd.live_head);
|
|
return -1;
|
|
}
|
|
@@ -230,5 +234,6 @@
|
|
NULL) {
|
|
rrd_set_error("allocating rrd.rra_def");
|
|
- rrd_free(&rrd);
|
|
+ free(rrd.stat_head);
|
|
+ free(rrd.live_head);
|
|
return (-1);
|
|
}
|
|
@@ -481,5 +486,6 @@
|
|
/* all errors are unrecoverable */
|
|
free(argvcopy);
|
|
- rrd_free(&rrd);
|
|
+ free(rrd.stat_head);
|
|
+ free(rrd.live_head);
|
|
return (-1);
|
|
}
|
|
@@ -508,5 +514,6 @@
|
|
-1) {
|
|
rrd_set_error("creating contingent RRA");
|
|
- rrd_free(&rrd);
|
|
+ free(rrd.stat_head);
|
|
+ free(rrd.live_head);
|
|
return -1;
|
|
}
|
|
@@ -515,5 +522,6 @@
|
|
} else {
|
|
rrd_set_error("can't parse argument '%s'", argv[i]);
|
|
- rrd_free(&rrd);
|
|
+ free(rrd.stat_head);
|
|
+ free(rrd.live_head);
|
|
return -1;
|
|
}
|
|
@@ -523,5 +531,6 @@
|
|
if (rrd.stat_head->rra_cnt < 1) {
|
|
rrd_set_error("you must define at least one Round Robin Archive");
|
|
- rrd_free(&rrd);
|
|
+ free(rrd.stat_head);
|
|
+ free(rrd.live_head);
|
|
return (-1);
|
|
}
|
|
@@ -529,5 +538,6 @@
|
|
if (rrd.stat_head->ds_cnt < 1) {
|
|
rrd_set_error("you must define at least one Data Source");
|
|
- rrd_free(&rrd);
|
|
+ free(rrd.stat_head);
|
|
+ free(rrd.live_head);
|
|
return (-1);
|
|
}
|
|
@@ -665,5 +675,6 @@
|
|
if ((rrd_file = open(file_name, O_WRONLY | O_CREAT | O_TRUNC, 0666)) < 0) {
|
|
rrd_set_error("creating '%s': %s", file_name, rrd_strerror(errno));
|
|
- rrd_free(rrd);
|
|
+ free(rrd->stat_head);
|
|
+ free(rrd->live_head);
|
|
return (-1);
|
|
}
|
|
@@ -680,5 +691,6 @@
|
|
if ((rrd->pdp_prep = calloc(1, sizeof(pdp_prep_t))) == NULL) {
|
|
rrd_set_error("allocating pdp_prep");
|
|
- rrd_free(rrd);
|
|
+ free(rrd->stat_head);
|
|
+ free(rrd->live_head);
|
|
close(rrd_file);
|
|
return (-1);
|
|
@@ -696,5 +708,6 @@
|
|
if ((rrd->cdp_prep = calloc(1, sizeof(cdp_prep_t))) == NULL) {
|
|
rrd_set_error("allocating cdp_prep");
|
|
- rrd_free(rrd);
|
|
+ free(rrd->stat_head);
|
|
+ free(rrd->live_head);
|
|
close(rrd_file);
|
|
return (-1);
|
|
@@ -743,5 +756,6 @@
|
|
if ((rrd->rra_ptr = calloc(1, sizeof(rra_ptr_t))) == NULL) {
|
|
rrd_set_error("allocating rra_ptr");
|
|
- rrd_free(rrd);
|
|
+ free(rrd->stat_head);
|
|
+ free(rrd->live_head);
|
|
close(rrd_file);
|
|
return (-1);
|
|
@@ -760,5 +774,6 @@
|
|
if ((unknown = (rrd_value_t *) malloc(512 * sizeof(rrd_value_t))) == NULL) {
|
|
rrd_set_error("allocating unknown");
|
|
- rrd_free(rrd);
|
|
+ free(rrd->stat_head);
|
|
+ free(rrd->live_head);
|
|
close(rrd_file);
|
|
return (-1);
|
|
@@ -778,5 +793,6 @@
|
|
free(unknown);
|
|
fdatasync(rrd_file);
|
|
- rrd_free(rrd);
|
|
+ free(rrd->stat_head);
|
|
+ free(rrd->live_head);
|
|
if (close(rrd_file) == -1) {
|
|
rrd_set_error("creating rrd: %s", rrd_strerror(errno));
|
|
@@ -786,4 +802,5 @@
|
|
rrd_file_dn = rrd_open(file_name, &rrd_dn, RRD_READONLY);
|
|
rrd_dontneed(rrd_file_dn, &rrd_dn);
|
|
+ rrd_free(&rrd_dn);
|
|
rrd_close(rrd_file_dn);
|
|
return (0);
|