fixes for valgrind

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@7721 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Marcelo Matus 2005-10-25 14:52:30 +00:00
commit 07df4a57db
3 changed files with 8 additions and 7 deletions

View file

@ -27,7 +27,7 @@
const char * casts1(const char *m = (const char *) NULL) {
char *ret = NULL;
if (m) {
ret = new char[strlen(m+1)];
ret = new char[strlen(m)+1];
strcpy(ret, m);
}
return ret;
@ -35,7 +35,7 @@
const char * casts2(const char *m = (const char *) "Hello") {
char *ret = NULL;
if (m) {
ret = new char[strlen(m+1)];
ret = new char[strlen(m)+1];
strcpy(ret, m);
}
return ret;