iliaa Wed Jun 30 09:43:09 2004 EDT
Modified files: (Branch: PHP_4_3)
/php-src/ext/msession msession.c
Log:
MFH: Another instance where alloca() is not needed.
http://cvs.php.net/diff.php/php-src/ext/msession/msession.c?r1=1.37.4.1&r2=1.37.4.2&ty=u
Index: php-src/ext/msession/msession.c
diff -u php-src/ext/msession/msession.c:1.37.4.1
php-src/ext/msession/msession.c:1.37.4.2
--- php-src/ext/msession/msession.c:1.37.4.1 Tue Dec 31 11:34:56 2002
+++ php-src/ext/msession/msession.c Wed Jun 30 09:43:08 2004
@@ -1266,7 +1266,7 @@
{
int port;
int len = strlen(save_path)+1;
- char * path = alloca(len);
+ char * path = emalloc(len);
char * szport;
strcpy(path, save_path);
@@ -1285,7 +1285,13 @@
ELOG( "ps_open_msession");
PS_SET_MOD_DATA((void *)1); /* session.c needs a non-zero here! */
- return PHPMsessionConnect(path, port) ? SUCCESS : FAILURE;
+ if (PHPMsessionConnect(path, port)) {
+ efree(path);
+ return SUCCESS;
+ } else {
+ efree(path);
+ return FAILURE;
+ }
}
PS_CLOSE_FUNC(msession)
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php