[AGENT++] heap corruption when delete a dynamic Snmp object

Wang Fang wangfangcs at gmail.com
Wed Jul 21 14:04:48 CEST 2010


Hi

I am using vc++ 2008 and SNMP++v3.2.24, the testing code are:
#include "snmp_pp.h"
int main()
{
    Snmp::socket_startup();
    int status;
    Snmp *p = new Snmp(status);
    delete p;       // heap corruption
    Snmp::socket_cleanup();
    return 0;
}

The error message are:
Windows has triggered a breakpoint in SNMPTrapSender.exe.

This may be due to a corruption of the heap, which indicates a bug in
SNMPTrapSender.exe or any of the DLLs it has loaded.

This may also be due to the user pressing F12 while SNMPTrapSender.exe
has focus.

The output window may have more diagnostic information.

-- 
Best Regards,
Wang Fang



More information about the AGENTPP mailing list