[vorbis-dev] Nonportable use of strdup()

Sam Lantinga slouken at devolution.com
Tue Dec 18 10:14:50 PST 2001



> strdup() might not be portable, but almost every compiler in the world
> has it, except MetroWerks CodeWarrior, both on Windows and Mac. And
> even they have it somewhere, only they call it _strdup, for reasons
> unknown to me.

Actually, I was building with MPW, which isn't addressed in the patch.
The real problem is that strdup() calls malloc() internally, and the
vorbis library is neither freeing the strings returned by strdup(),
nor using the application provided memory functions to manage them.

It doesn't matter for me, since I already patched the code locally to
use the ogg memory functions, but I thought you would want to know.

Again, I'm not subscribed, so please CC me on replies.

See ya,
        -Sam Lantinga, Software Engineer, Blizzard Entertainment

--- >8 ----
List archives:  http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'vorbis-dev-request at xiph.org'
containing only the word 'unsubscribe' in the body.  No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.



More information about the Vorbis-dev mailing list