shithub: choc

Download patch

ref: 9d01d090c48c74a29b4ef67e0cd204772a2193c3
parent: b42b5269e0ad5b22acd6043429ec4013a4e76ddd
author: Simon Howard <fraggle@gmail.com>
date: Fri Oct 24 16:29:56 EDT 2014

Replace strdup() with M_StringDuplicate().

strdup() can theoretically fail and return NULL. This could lead to
a crash or undesirable behavior. Add M_StringDuplicate() which does
the same thing but exits with an error if a string cannot be
allocated.

This fixes #456. Thanks to Quasar for the suggestion.