X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Frrd_fetch_libdbi.c;h=2c4c722ee46ecbbbd8d95ece84c8deb8c4899d5a;hb=513304e8a967fa471a0028711ddd3d95ce812d7d;hp=7ca809e34f613193ddc04ae97abaaccdaaf84c42;hpb=46a2db0465372eae273b1ff827e465a779339198;p=rrdtool.git diff --git a/src/rrd_fetch_libdbi.c b/src/rrd_fetch_libdbi.c index 7ca809e..2c4c722 100644 --- a/src/rrd_fetch_libdbi.c +++ b/src/rrd_fetch_libdbi.c @@ -401,6 +401,7 @@ rrd_fetch_fn_libdbi( char where[10240]; table_help.conn=NULL; table_help.where=where; + table_help.filename=filename; /* some loop variables */ int i=0; @@ -564,7 +565,7 @@ rrd_fetch_fn_libdbi( } /* allocate memory for resultset (with the following columns: min,avg,max,count,sigma) */ - i=rows * sizeof(rrd_value_t)*(*ds_cnt); + i=(rows+1) * sizeof(rrd_value_t)*(*ds_cnt); if (((*data) = malloc(i))==NULL){ /* and return error */ rrd_set_error("malloc failed for %i bytes",i);