]> granicus.if.org Git - php/commitdiff
MFH: Another instance where alloca() is not needed.
authorIlia Alshanetsky <iliaa@php.net>
Wed, 30 Jun 2004 13:43:22 +0000 (13:43 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Wed, 30 Jun 2004 13:43:22 +0000 (13:43 +0000)
ext/msession/msession.c

index 1cafb9a3397afdd97149ed2904ae7acc50f496cb..cc77906a90dfc23b91763453b20e0ba6b8c5b6e2 100644 (file)
@@ -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)