From: Ilia Alshanetsky Date: Wed, 30 Jun 2004 13:43:22 +0000 (+0000) Subject: MFH: Another instance where alloca() is not needed. X-Git-Tag: php-4.3.9RC1~66 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=549b2ae9fe4ff096a0055f477e3881c76d81324f;p=php MFH: Another instance where alloca() is not needed. --- 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)