Fix off by 1 memory allocation

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@10127 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
William S Fulton 2007-11-14 22:30:01 +00:00
commit 22126ca549

View file

@ -150,7 +150,7 @@ SWIG_AsCharPtrAndSize(SEXP obj, char** cptr, size_t* psize, int *alloc)
SWIGINTERN char *
SWIG_strdup(const char *str)
{
char *newstr = %reinterpret_cast(malloc(strlen(str)), char *);
char *newstr = %reinterpret_cast(malloc(strlen(str) + 1), char *);
return strcpy(newstr, str);
}
}