Fixed [ 798205 ] Segfault in SWIG_ConvertPtr.

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5046 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Dave Beazley 2003-09-01 17:11:13 +00:00
commit fb447a777a

View file

@ -275,7 +275,7 @@ cobject:
type_error:
if (flags & SWIG_POINTER_EXCEPTION) {
if (ty) {
if (ty && c) {
char *temp = (char *) malloc(64+strlen(ty->name)+strlen(c));
sprintf(temp,"Type error. Got %s, expected %s", c, ty->name);
PyErr_SetString(PyExc_TypeError, temp);
@ -308,7 +308,7 @@ SWIG_ConvertPacked(PyObject *obj, void *ptr, int sz, swig_type_info *ty, int fla
type_error:
if (flags) {
if (ty) {
if (ty && c) {
char *temp = (char *) malloc(64+strlen(ty->name)+strlen(c));
sprintf(temp,"Type error. Got %s, expected %s", c, ty->name);
PyErr_SetString(PyExc_TypeError, temp);