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

Re: strdup vs _strdup on Windows builds


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
>
>
>
>

Follow-Ups:
RE: strdup vs _strdup on Windows builds"Murphy, Gearoid P" <gearoid.murphy@xxxxxx>
References:
strdup vs _strdup on Windows builds"Murphy, Gearoid P" <gearoid.murphy@xxxxxx>
Archive administrator: postmaster@lists.cynapses.org