Hi Ken,

You shouldn't mix this:

>    soldier->name = strdup(name);

with this:

>    Safefree(soldier->name);

because strdup() is just a C library function that uses malloc(), and
Safefree might not be. You want to use savepv(), which is the Perl API's
equivalent that's guaranteed to work with Safefree.

Have a look at 'perldoc perlapi' for more info.

Later,
Neil

Reply via email to