[rrd-developers] Re: Wnat to use rrd into C

Rogério Schneider stockrt at gmail.com
Thu Jul 20 22:59:43 MEST 2006


My code, for a daemon, need to free() memory, or else I can run out off :)
Att,
Rogério Schneider

> [snip]
>
> >    /* Was it OK ? */
> >    if (rrd_test_error() || (result != 0)) {
> >        if (calcpr) {
> >            int i;
> >            for (i=0; (calcpr[i]); i++) free(calcpr[i]);
> >            calcpr = NULL;
> >        }
>
> Does calcpr have to be freed later if the call to rrd_graph was
> successful?  I don't see that in your example or in hobbitgraph.c
> (which this example is very similar to).

I believe so, yes. From what I remember, the calcpr memory is allocated
by rrd_graph(), but it is your responsibility to free it after you've
finished using it.

If my code doesn't do it, it is probably because this particular tool
never runs for very long, so any memory leaks are not terribly
important. You may of course have different needs.


Regards,
Henrik

--
Unsubscribe mailto:rrd-developers-request at list.ee.ethz.ch?subject=unsubscribe
Help        mailto:rrd-developers-request at list.ee.ethz.ch?subject=help
Archive     http://lists.ee.ethz.ch/rrd-developers
WebAdmin    http://lists.ee.ethz.ch/lsg2.cgi



More information about the rrd-developers mailing list