Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] [MEMLEAK] Memory leak in Phalcon\Debug::setCharset(), setLinesBeforeContext(), setLinesAfterContext() #1345

Closed
ghost opened this issue Oct 8, 2013 · 1 comment

Comments

@ghost
Copy link

ghost commented Oct 8, 2013

Test case (will be similar for all functions):

$d = new \Phalcon\Debug();
$f1 = 1;
$f2 = $f1;
$d->setCharset($f2);

Produces:

[Tue Oct  8 04:29:11 2013]  Script:  '/home/vladimir/workspace/cphalcon/ext/tests/memleak.phpt'
/home/vladimir/workspace/cphalcon/ext/debug.c(1236) :  Freeing 0x7F004D66F538 (32 bytes), script=/home/vladimir/workspace/cphalcon/ext/tests/memleak.phpt
[Tue Oct  8 04:29:11 2013]  Script:  '/home/vladimir/workspace/cphalcon/ext/tests/memleak.phpt'
/tmp/php-build/source/5.5.4/main/spprintf.c(777) :  Freeing 0x7F004D66F5B8 (79 bytes), script=/home/vladimir/workspace/cphalcon/ext/tests/memleak.phpt
@ghost
Copy link
Author

ghost commented Oct 8, 2013

This happens because PHALCON_SEPARATE_PARAM_NMO() does not decrement the refcount when it separates the argument.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

0 participants