Wireshark-bugs: [Wireshark-bugs] [Bug 7773] New: Explicitly assign pointers released by g_free()

Date: Sun, 30 Sep 2012 11:18:10 -0700 (PDT)
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7773

           Summary: Explicitly assign pointers released by g_free() to
                    NULL
           Product: Wireshark
           Version: 1.8.2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Normal
          Priority: Low
         Component: Extras
        AssignedTo: bugzilla-admin@xxxxxxxxxxxxx
        ReportedBy: wp02855@xxxxxxxxx


Created attachment 9253
  --> https://bugs.wireshark.org/bugzilla/attachment.cgi?id=9253
Patch files for wireshark 1.8.2 generated by diff -u

Build Information:
Source Tarball is 1.8.2
--
The files included in this tarball are patchfiles generated by 'diff -u' which
explicitly set pointer variables released by a call to g_free() to NULL.  In
reviewing various code files, in some cases, the freed pointer is explicitly
assigned to NULL and in other instances it is not.  

In most contexts, when a pointer is released via free, should not the following
occur?

char *p;

p = malloc(1000);

if (p == NULL)
    didn't get memory due to failure of malloc
else
    some more processing here
    free(p);
    p = NULL;

more stuff here

program ends.

Or am I mistaken in this issue?

Here is a listing of the files contained in wireshark-patch.tar.gz:

odie:/usr/local/src/patchfiles/wireshark-1.8.2 # tar tvf wireshark-patch.tar.gz 
-rw-r--r-- root/root      1176 2012-09-30 10:31 mergecap.c.patch
-rw-r--r-- root/root      1330 2012-09-30 10:27 print.c.patch
-rw-r--r-- root/root       274 2012-09-30 10:23 proto_hier_stats.c.patch
-rw-r--r-- root/root       772 2012-09-30 10:20 rawshark.c.patch
-rw-r--r-- root/root      1801 2012-09-30 10:17 recent.c.patch
-rw-r--r-- root/root       471 2012-09-30 10:09 summary.c.patch
-rw-r--r-- root/root       267 2012-09-30 10:06 tempfile.c.patch
-rw-r--r-- root/root       269 2012-09-30 10:04 text2pcap.c.patch
-rw-r--r-- root/root      5134 2012-09-30 10:00 tshark.c.patch

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