From 549b2ae9fe4ff096a0055f477e3881c76d81324f Mon Sep 17 00:00:00 2001 From: Ilia Alshanetsky Date: Wed, 30 Jun 2004 13:43:22 +0000 Subject: [PATCH] MFH: Another instance where alloca() is not needed. --- ext/msession/msession.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/ext/msession/msession.c b/ext/msession/msession.c index 1cafb9a339..cc77906a90 100644 --- a/ext/msession/msession.c +++ b/ext/msession/msession.c @@ -1266,7 +1266,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); @@ -1285,7 +1285,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) -- 2.50.1