summaryrefslogtreecommitdiff
path: root/ext/msession
diff options
context:
space:
mode:
authorIlia Alshanetsky <iliaa@php.net>2004-06-30 13:43:16 +0000
committerIlia Alshanetsky <iliaa@php.net>2004-06-30 13:43:16 +0000
commitbdfd8c60ea5332738fc8705c5a66d854591030f7 (patch)
tree9ad570ac44ff259e2c5dc9f5e3dc2cb1d556b70c /ext/msession
parent81dbc2fcef6a104402729ab21e7e106337408f0b (diff)
downloadphp-git-bdfd8c60ea5332738fc8705c5a66d854591030f7.tar.gz
Another instance where alloca() is not needed.
Diffstat (limited to 'ext/msession')
-rw-r--r--ext/msession/msession.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/ext/msession/msession.c b/ext/msession/msession.c
index 25233e28f8..60f4360808 100644
--- a/ext/msession/msession.c
+++ b/ext/msession/msession.c
@@ -1290,7 +1290,7 @@ PS_OPEN_FUNC(msession)
{
int port;
int len = strlen(save_path)+1;
- char * path = alloca(len);
+ char * path = emalloc(len);
char * szport;
strcpy(path, save_path);
@@ -1309,7 +1309,13 @@ PS_OPEN_FUNC(msession)
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)