[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: strdup vs _strdup on Windows builds
[Thread Prev] | [Thread Next]
- Subject: Re: strdup vs _strdup on Windows builds
- From: Paulo Panhoto <paulo.panhoto@xxxxxxxxx>
- Reply-to: libssh@xxxxxxxxxx
- Date: Wed, 15 Jun 2011 08:55:50 -0300
- To: libssh@xxxxxxxxxx
Hi, I found a link that might be related to this problem: http://connect.microsoft.com/VisualStudio/feedback/details/333868/programs-using-a-static-library-and-calling-strdup-crash Regards, Paulo On Wed, Jun 15, 2011 at 6:35 AM, Murphy, Gearoid P <gearoid.murphy@xxxxxx>wrote: > Hi > > I've run into a heap corruption assertion whilst running the example > programs shipped with the libhssh source. I'm building on an x64 Windows 7 > VM using Visual Studio 2008 with libssh 0.5.0. > > Debugging always traced the error to the process of freeing memory > allocated via strdup. MSDN documentation states that strdup was deprecated > from Visual Studio 2005 onwards. > http://msdn.microsoft.com/en-us/library/ms235454(v=vs.80).aspx< > http://msdn.microsoft.com/en-us/library/ms235454%28v=vs.80%29.aspx> > > Unfortunately, this sort of volatility is a constant issue on Windows > systems. Nothing like having a monopoly to compensate for brain-dead > technical decisions ;-). I was able to address the issue by refactoring the > code to use _strdup instead of strdup but I'd rather not have to do this > each time I compile a new build of libssh. I'd be happy to assist wherever > possible but I'd like to get some feedback first. > > Thanks > - Gearoid > > > >
RE: strdup vs _strdup on Windows builds | "Murphy, Gearoid P" <gearoid.murphy@xxxxxx> |
strdup vs _strdup on Windows builds | "Murphy, Gearoid P" <gearoid.murphy@xxxxxx> |