Add missing snmp_free_pdu
Check if malloc fails.