php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #58422 fetch(), getAccessToken() - Memory leaks
Submitted: 2008-11-21 07:40 UTC Modified: 2008-11-22 15:43 UTC
From: felipe@php.net Assigned: jawed (profile)
Status: Closed Package: oauth (PECL)
PHP Version: 5_2 CVS-2008-11-21 (dev) OS: Linux
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: felipe@php.net
New email:
PHP Version: OS:

 

 [2008-11-21 07:40 UTC] felipe@php.net
Description:
------------
The following code in oauth::fetch needs be moved to down of its arguments checks, because it's causing memory leak obviously:

ALLOC_HASHTABLE(args);
zend_hash_init(args, 0, NULL, ZVAL_PTR_DTOR, 0);


Reproduce code:
---------------
<?php

$x = new oauth(1,1);
$x->fetch();

Actual result:
--------------
Warning: Wrong parameter count for OAuth::fetch() in /home/felipe/dev/bug.php on line 4
[Fri Nov 21 10:33:41 2008]  Script:  '../bug.php'
/home/felipe/dev/php5_2/ext/oauth/oauth.c(1021) :  Freeing 0x085FAEC8 (44 bytes), script=../bug.php
[Fri Nov 21 10:33:41 2008]  Script:  '../bug.php'
/home/felipe/dev/php5_2/ext/oauth/oauth.c(1022) :  Freeing 0x085FAF24 (32 bytes), script=../bug.php
/home/felipe/dev/php5_2/Zend/zend_alloc.c(2386) : Actual location (location was relayed)
=== Total 2 memory leaks detected ===


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-11-21 07:43 UTC] felipe@php.net
This also occurs with:
<?php

$x = new oauth(1,1);
$x->getAccessToken();

Warning: Wrong parameter count for OAuth::getAccessToken() in /home/felipe/dev/bug.php on line 4
[Fri Nov 21 10:42:32 2008]  Script:  '../bug.php'
/home/felipe/dev/php5_2/ext/oauth/oauth.c(1104) :  Freeing 0x085FAF08 (44 bytes), script=../bug.php
[Fri Nov 21 10:42:32 2008]  Script:  '../bug.php'
/home/felipe/dev/php5_2/ext/oauth/oauth.c(1105) :  Freeing 0x085FAF64 (32 bytes), script=../bug.php
/home/felipe/dev/php5_2/Zend/zend_alloc.c(2386) : Actual location (location was relayed)
=== Total 2 memory leaks detected ===
 [2008-11-21 08:05 UTC] felipe@php.net
The patch for Bug #15110 includes the fix for this bug too.
 [2008-11-22 04:49 UTC] jawed@php.net
Please check and verify whether or not the latest source in CVS resolves this bug.
 [2008-11-22 15:43 UTC] felipe@php.net
Yes, it's ok now.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Thu Jan 02 12:01:29 2025 UTC