[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

strdup vs _strdup on Windows builds


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



Follow-Ups:
Re: strdup vs _strdup on Windows buildsPaulo Panhoto <paulo.panhoto@xxxxxxxxx>
Archive administrator: postmaster@lists.cynapses.org