Skip to content

Commit bff3035

Browse files
committed
Fixed memleak (severs)
1 parent 1e7e4ee commit bff3035

File tree

3 files changed

+29
-0
lines changed

3 files changed

+29
-0
lines changed

package.xml

+1
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ Fixes
118118
<file role='test' name='session_basic.phpt'/>
119119
<file role='test' name='session_basic2.phpt'/>
120120
<file role='test' name='session_basic3.phpt'/>
121+
<file role='test' name='session_persistent.phpt'/>
121122
<file role='test' name='set_large.phpt'/>
122123
<file role='test' name='setoptions.phpt'/>
123124
<file role='test' name='touch_binary.phpt'/>

php_memcached_session.c

+1
Original file line numberDiff line numberDiff line change
@@ -351,6 +351,7 @@ PS_OPEN_FUNC(memcached)
351351
else {
352352
efree(plist_key);
353353
PS_SET_MOD_DATA(memc);
354+
memcached_server_list_free(servers);
354355
return SUCCESS;
355356
}
356357
}

tests/session_persistent.phpt

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
--TEST--
2+
Session persistent
3+
--SKIPIF--
4+
<?php
5+
include dirname(__FILE__) . "/skipif.inc";
6+
if (!Memcached::HAVE_SESSION) print "skip";
7+
?>
8+
--INI--
9+
session.save_handler=memcached
10+
memcached.sess_persistent=1
11+
--FILE--
12+
<?php
13+
include dirname (__FILE__) . '/config.inc';
14+
ini_set ('session.save_path', MEMC_SERVER_HOST . ':' . MEMC_SERVER_PORT);
15+
16+
session_start();
17+
$_SESSION['test']=true;
18+
session_write_close();
19+
session_start();
20+
var_dump($_SESSION);
21+
session_write_close();
22+
?>
23+
--EXPECT--
24+
array(1) {
25+
["test"]=>
26+
bool(true)
27+
}

0 commit comments

Comments
 (0)