2009/8/11 Tomas Macek <[email protected]>:
> This code below is a part from main() in the apps/snmpget.c. I'm trying to
> copy something from this to my own project and I don't understand well one
> thing: why you don't release the memory from "pdu" variable at the end?

>From 'snmp_api(3)'

       Error return status from  snmp_close  and  snmp_send  is  indicated  by
       return  of  0.   ...
        Upon  successful  return
       from snmp_send the pdu will be freed by the library.


> Trying to add the line at the end ("snmp_free_pdu(pdu)") leads to crash
> here in snmpget and in my own program leads to "double free" from glibc.
>
> Where is the memory released?

See above.

Dave

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to