php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #46543 ibase_trans() memory leaks when using wrong parameters
Submitted: 2008-11-11 13:07 UTC Modified: 2008-11-11 13:31 UTC
From: felipe@php.net Assigned: felipe
Status: Closed Package: InterBase related
PHP Version: 5.2CVS-2008-11-11 (snap) OS:
Private report: No CVE-ID:
 [2008-11-11 13:07 UTC] felipe@php.net
Description:
------------
See below.

Reproduce code:
---------------
ibase_trans(1);
ibase_trans();
ibase_trans('foo');
ibase_trans(fopen(__FILE__, 'r'));

$x = ibase_connect('/home/felipe/teste.fdb', 'foo', 'bar');
ibase_trans(1, 2, $x, $x, 3);

Expected result:
----------------
Warning: ibase_trans(): no Firebird/InterBase link resource supplied in /home/felipe/dev/bug.php on line 3

Warning: ibase_trans(): no Firebird/InterBase link resource supplied in /home/felipe/dev/bug.php on line 4

Warning: ibase_trans(): no Firebird/InterBase link resource supplied in /home/felipe/dev/bug.php on line 5

Warning: ibase_trans(): supplied resource is not a valid Firebird/InterBase link resource in /home/felipe/dev/bug.php on line 6


Actual result:
--------------
Warning: ibase_trans(): no Firebird/InterBase link resource supplied in /home/felipe/dev/bug.php on line 3

Warning: ibase_trans(): no Firebird/InterBase link resource supplied in /home/felipe/dev/bug.php on line 4

Warning: ibase_trans(): no Firebird/InterBase link resource supplied in /home/felipe/dev/bug.php on line 5

Warning: ibase_trans(): supplied resource is not a valid Firebird/InterBase link resource in /home/felipe/dev/bug.php on line 6
[Tue Nov 11 11:05:43 2008]  Script:  '../bug.php'
/home/felipe/dev/php6/ext/interbase/interbase.c(1194) :  Freeing 0x0897BF38 (8 bytes), script=../bug.php
/home/felipe/dev/php6/Zend/zend_alloc.c(2448) : Actual location (location was relayed)
Last leak repeated 3 times
[Tue Nov 11 11:05:43 2008]  Script:  '../bug.php'
/home/felipe/dev/php6/ext/interbase/interbase.c(1209) :  Freeing 0x0897BF70 (8 bytes), script=../bug.php
/home/felipe/dev/php6/Zend/zend_alloc.c(2448) : Actual location (location was relayed)
[Tue Nov 11 11:05:43 2008]  Script:  '../bug.php'
/home/felipe/dev/php6/ext/interbase/interbase.c(1200) :  Freeing 0x0897C250 (4 bytes), script=../bug.php
/home/felipe/dev/php6/Zend/zend_alloc.c(2448) : Actual location (location was relayed)
[Tue Nov 11 11:05:43 2008]  Script:  '../bug.php'
/home/felipe/dev/php6/ext/interbase/interbase.c(1208) :  Freeing 0x0897C530 (12 bytes), script=../bug.php
/home/felipe/dev/php6/Zend/zend_alloc.c(2448) : Actual location (location was relayed)
=== Total 7 memory leaks detected ===


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-11-11 13:31 UTC] felipe@php.net
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2014 The PHP Group
All rights reserved.
Last updated: Wed Apr 16 10:02:09 2014 UTC