Huge thanks to our Platinum Members Endace and LiveAction,
and our Silver Member Veeam, for supporting the Wireshark Foundation and project.

Wireshark-bugs: [Wireshark-bugs] [Bug 4164] New: Cleanup dissector code - use proper memory func

Date: Sun, 25 Oct 2009 03:55:33 -0700 (PDT)
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=4164

           Summary: Cleanup dissector code - use proper memory functions
           Product: Wireshark
           Version: SVN
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Enhancement
          Priority: Low
         Component: Wireshark
        AssignedTo: wireshark-bugs@xxxxxxxxxxxxx
        ReportedBy: darkjames@xxxxxxxxxxxxxxxx



Jakub Zawadzki <darkjames@xxxxxxxxxxxxxxxx> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Attachment #3843|                            |review_for_checkin?
               Flag|                            |


Created an attachment (id=3843)
 --> (https://bugs.wireshark.org/bugzilla/attachment.cgi?id=3843)
Cleanup memory usage

Build Information:

--
Hello,

this patch cleanup some code (mainly in dissectors), like:
 - Memory allocation with memset to {ep,se}_alloc0
 - Memory allocation with memcpy to {ep,se}_memdup
 - Memory allocation with g_snprintf to ep_strdup_printf() [or sometimes to
ep_strdup()]
 - Code like:
       buf = ep_alloc0(real_len + 1);
       memcpy(buf, p, real_len);
   To:
       buf = ep_strndup(p, real_len);

 - Where string can be const don't duplicate it to ep memory.

& many others.

Stats: 49 files changed, 183 insertions(+), 388 deletions(-)

There're still more issues like these on code, so please don't close the bug.

(I double check the patch - but there still might be some small errors ;/)


-- 
Configure bugmail: https://bugs.wireshark.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.