Wireshark-dev: Re: [Wireshark-dev] Problems with epan\oids.c

From: "Peter Johansson" <peterjohansson73@xxxxxxxxx>
Date: Thu, 13 Mar 2008 13:29:57 +0100
2008/3/13, Peter Johansson <peterjohansson73@xxxxxxxxx>:
The recent changes (since Jan 30) that have been applied to epan\oids.c causes problems, at least on Windows.
I ran into the problem today when I thought I should have a go at bug #2356.
 
I opened wireshark-gtk2\wireshark.exe as the solution to use in Developer Studio 2005 (not EE), just to be able to run the entire Wireshark session under the debugger.
However I cannot get passed the initialization of Wireshark because the debugger halts in oids.c, line 578 - free (oid);
When commenting out that line, the debugger instead halts on line 298 - free (name);
When commenting out that line, the debugger instead halts on line 294 - free (name);
When commenting out that line, the debugger instead halts on line 387 - free (oid1);
When commenting out that line, the debugger instead halts on line 388 - free (oid2);
When commenting out that line, I can at can continue to run in the debugger.
 
The debugger behaves in the same manner as it does if I call free for an already freed portion of memory.
Note that I do not encounter any problems when running Wireshark outside the debugger.
 
Why were these calls to free added?
 
I went through the source code for libsmi-0.4.5 and agree that free *should* be required if "HAVE_VASPRINTF" was not defined when compiling libsmi for Windows. In that case, there exist an implementation in the library that will return memory allocated using realloc (after malloc). Hence the calls to free are correct then. But what is the case here? Was HAVE_VASPRINTF defined or not when the smi library was compiled for Windows?
 
Any ideas on how to address this?
 
/ Peter

 
The problems are due to the changes applied to oids.c March 5 (SVN 24569), not from Jan 30 as I said before.
 
/ Regards, Peter