John Naylon wrote:
Hello,

[EMAIL PROTECTED] said:
MJS> Please review bug [ 1040429 ] memory leaked past f_fmtaddr calls

This looks fine to me -- as Mike says, all fmtaddr methods return heap memory which needs to be free()d. I would suggest that in snmp_api.c and snmp_agent.c that the relevant variable be set to NULL after being free()d to make more obvious any code path that subsequently deferences same (by causing a SEGV).


All uses of the function addressed by transport->f_fmtaddr
test the return value for NULL before using that value.

The bugfix (second patch) was applied to the 5.1 patches and main branches.




[EMAIL PROTECTED] said:

It seems to me that it might also make sense to move the host_ctl stuff
into the transport code itself.


I like this idea a lot. Probably the right thing to do would be to add a method to the transport object that will perform the appropriate checking if non-NULL. NULL would imply "always succeeds" which is probably appropriate for AAL5, IPX, callback. This is a much simpler test than "formatted string contains '['"! The transport-specific code can mangle strings more efficiently for passing to tcp_wrappers too. Better encapsulation all round.

  Cheers all,

John

Tha it a great idea for 5.3. Until then... Another patch scanning for '[' was applied by Wes. I've updated patches in bug# 1040431 for peer review. http://sourceforge.net/tracker/index.php?func=detail&aid=1040431&group_id=12694&atid=112694 -Mike Slifcak


------------------------------------------------------- This SF.net email is sponsored by: IT Product Guide on ITManagersJournal Use IT products in your business? Tell us what you think of them. Give us Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more http://productguide.itmanagersjournal.com/guidepromo.tmpl _______________________________________________ Net-snmp-coders mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to