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:[EMAIL PROTECTED]
Help        mailto:[EMAIL PROTECTED]
Archive     http://lists.ee.ethz.ch/rrd-developers
WebAdmin    http://lists.ee.ethz.ch/lsg2.cgi

Reply via email to