[AGENT++] get_printable_oid memory management

Cheney, Christian CheneyC at wsdot.wa.gov
Tue Sep 7 19:58:55 CEST 2004


The Vb consists of an Oid and a value.  get_printable_oid() simply calls
get_printable() for the Oid object.  If one looks inside the
Oid::get_printable function they will discover that the Oid object allocates
and deletes the memory that is used to return a value in these functions.

-----Original Message-----
From: Ramin Dousti [mailto:ramin at cannon.eng.us.uu.net]
Sent: Tuesday, September 07, 2004 8:19 AM
To: agentpp at agentpp.org
Subject: [AGENT++] get_printable_oid memory management


Hello,

I have a simple (and maybe stupid) question.

The short version of the question is "Who is responsible for the memory
de-allocation of the memory block pointed by get_printable_oid() of a Vb
object?"

Now a slightly more verbose version of the question: I have a simple trap
processing application. Every time a trap comes in I extract the info
from the PDU (by means of get_printable_...()), and process it accordingly.
I noticed a very slow memory leak in my application and tried to correct
it and have not (yet) been able to locate the cause of it. However, the
above member function returns a "const char *" which I believe is being
allocated on the heap and if that's the case I was wondering who is doing
the memory management for it.       

Thank you in advance,
Ramin
_______________________________________________
AGENTPP mailing list
AGENTPP at agentpp.org
http://agentpp.org/mailman/listinfo/agentpp



More information about the AGENTPP mailing list