You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

115 lines
4.8 KiB

# --- SDE-COPYRIGHT-NOTE-BEGIN ---
# This copyright note is auto-generated by ./scripts/Create-CopyPatch.
#
# Filename: package/.../rrdtool/rrdtool-1.2.19-rrd_dump.patch
# Copyright (C) 2007 The OpenSDE Project
#
# More information can be found in the files COPYING and README.
#
# This patch file is dual-licensed. It is available under the license the
# patched project is licensed under, as long as it is an OpenSource license
# as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
# of the GNU General Public License as published by the Free Software
# Foundation; either version 2 of the License, or (at your option) any later
# version.
# --- SDE-COPYRIGHT-NOTE-END ---
fix memmory problem in rrd_dump.c
--- ./src/rrd_dump.c (Revision 1009)
+++ ./src/rrd_dump.c (Revision 1010)
@@ -115,39 +115,39 @@
fprintf(out_file, "\t<lastupdate> %ld </lastupdate> <!-- %s -->\n\n",
rrd.live_head->last_up,somestring);
for(i=0;i<rrd.stat_head->ds_cnt;i++){
- fprintf(out_file, "\t<ds>\n");
- fprintf(out_file, "\t\t<name> %s </name>\n",rrd.ds_def[i].ds_nam);
- fprintf(out_file, "\t\t<type> %s </type>\n",rrd.ds_def[i].dst);
- if (dst_conv(rrd.ds_def[i].dst) != DST_CDEF) {
- fprintf(out_file, "\t\t<minimal_heartbeat> %lu </minimal_heartbeat>\n",rrd.ds_def[i].par[DS_mrhb_cnt].u_cnt);
- if (isnan(rrd.ds_def[i].par[DS_min_val].u_val)){
- fprintf(out_file, "\t\t<min> NaN </min>\n");
- } else {
- fprintf(out_file, "\t\t<min> %0.10e </min>\n",rrd.ds_def[i].par[DS_min_val].u_val);
- }
- if (isnan(rrd.ds_def[i].par[DS_max_val].u_val)){
- fprintf(out_file, "\t\t<max> NaN </max>\n");
- } else {
- fprintf(out_file, "\t\t<max> %0.10e </max>\n",rrd.ds_def[i].par[DS_max_val].u_val);
- }
- } else { /* DST_CDEF */
- char *str;
- rpn_compact2str((rpn_cdefds_t *) &(rrd.ds_def[i].par[DS_cdef]),rrd.ds_def,&str);
- fprintf(out_file, "\t\t<cdef> %s </cdef>\n", str);
- free(str);
- }
- fprintf(out_file, "\n\t\t<!-- PDP Status -->\n");
- fprintf(out_file, "\t\t<last_ds> %s </last_ds>\n",rrd.pdp_prep[i].last_ds);
- if (isnan(rrd.pdp_prep[i].scratch[PDP_val].u_val)){
- fprintf(out_file, "\t\t<value> NaN </value>\n");
- } else {
- fprintf(out_file, "\t\t<value> %0.10e </value>\n",rrd.pdp_prep[i].scratch[PDP_val].u_val);
- }
- fprintf(out_file, "\t\t<unknown_sec> %lu </unknown_sec>\n",
- rrd.pdp_prep[i].scratch[PDP_unkn_sec_cnt].u_cnt);
+ fprintf(out_file, "\t<ds>\n");
+ fprintf(out_file, "\t\t<name> %s </name>\n",rrd.ds_def[i].ds_nam);
+ fprintf(out_file, "\t\t<type> %s </type>\n",rrd.ds_def[i].dst);
+ if (dst_conv(rrd.ds_def[i].dst) != DST_CDEF) {
+ fprintf(out_file, "\t\t<minimal_heartbeat> %lu </minimal_heartbeat>\n",rrd.ds_def[i].par[DS_mrhb_cnt].u_cnt);
+ if (isnan(rrd.ds_def[i].par[DS_min_val].u_val)){
+ fprintf(out_file, "\t\t<min> NaN </min>\n");
+ } else {
+ fprintf(out_file, "\t\t<min> %0.10e </min>\n",rrd.ds_def[i].par[DS_min_val].u_val);
+ }
+ if (isnan(rrd.ds_def[i].par[DS_max_val].u_val)){
+ fprintf(out_file, "\t\t<max> NaN </max>\n");
+ } else {
+ fprintf(out_file, "\t\t<max> %0.10e </max>\n",rrd.ds_def[i].par[DS_max_val].u_val);
+ }
+ } else { /* DST_CDEF */
+ char *str=NULL;
+ rpn_compact2str((rpn_cdefds_t *) &(rrd.ds_def[i].par[DS_cdef]),rrd.ds_def,&str);
+ fprintf(out_file, "\t\t<cdef> %s </cdef>\n", str);
+ free(str);
+ }
+ fprintf(out_file, "\n\t\t<!-- PDP Status -->\n");
+ fprintf(out_file, "\t\t<last_ds> %s </last_ds>\n",rrd.pdp_prep[i].last_ds);
+ if (isnan(rrd.pdp_prep[i].scratch[PDP_val].u_val)){
+ fprintf(out_file, "\t\t<value> NaN </value>\n");
+ } else {
+ fprintf(out_file, "\t\t<value> %0.10e </value>\n",rrd.pdp_prep[i].scratch[PDP_val].u_val);
+ }
+ fprintf(out_file, "\t\t<unknown_sec> %lu </unknown_sec>\n",
+ rrd.pdp_prep[i].scratch[PDP_unkn_sec_cnt].u_cnt);
- fprintf(out_file, "\t</ds>\n\n");
- }
+ fprintf(out_file, "\t</ds>\n\n");
+ }
fputs("<!-- Round Robin Archives -->", out_file);
--- ./src/rrd_tune.c (Revision 1009)
+++ ./src/rrd_tune.c (Revision 1010)
@@ -290,7 +290,7 @@
rrd.ds_def[i].par[DS_min_val].u_val,
rrd.ds_def[i].par[DS_max_val].u_val);
} else {
- char *buffer;
+ char *buffer = NULL;
rpn_compact2str((rpn_cdefds_t *) &(rrd.ds_def[i].par[DS_cdef]),rrd.ds_def,&buffer);
printf("DS[%s] typ: %s\tcdef: %s\n", rrd.ds_def[i].ds_nam,rrd.ds_def[i].dst,buffer);
free(buffer);
--- ./src/rrd_info.c (Revision 1009)
+++ ./src/rrd_info.c (Revision 1010)
@@ -117,7 +117,7 @@
switch (current_ds) {
case DST_CDEF:
{
- char *buffer = 0;
+ char *buffer = NULL;
rpn_compact2str((rpn_cdefds_t *) &(rrd.ds_def[i].par[DS_cdef]),
rrd.ds_def, &buffer);
info.u_str = buffer;