php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #67138 Memory leak with custom directories
Submitted: 2014-04-28 03:17 UTC Modified: 2014-04-28 14:16 UTC
Votes:1
Avg. Score:3.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: anthon at piwik dot org Assigned: ohill (profile)
Status: Closed Package: geoip (PECL)
PHP Version: Irrelevant OS:
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: anthon at piwik dot org
New email:
PHP Version: OS:

 

 [2014-04-28 03:17 UTC] anthon at piwik dot org
Description:
------------
GeoIPDBFileName is an array of pointers to malloc'd strings.  A single free() won't free it all.

Instead of:

if (GeoIPDBFileName != NULL) {
    free(GeoIPDBFileName);
    GeoIPDBFileName = NULL;
}

use:

GeoIP_cleanup();



Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2014-04-28 14:15 UTC] ohill@php.net
Automatic comment from SVN on behalf of ohill
Revision: http://svn.php.net/viewvc/?view=revision&revision=333444
Log: Bug #67138
 [2014-04-28 14:16 UTC] ohill@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: ohill
 [2014-04-28 14:16 UTC] ohill@php.net
Fixed on SVN. Thanks for the info anthon.

I have used cleanup for C lib > 1.4.7 and manually freed the array for other versions. Please try and let me know.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Dec 27 06:01:29 2024 UTC