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:
parent
3428bf10a6
commit
07df4a57db
3 changed files with 8 additions and 7 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue