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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
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

Add a Patch

Pull Requests

Add a Pull Request

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-2020 The PHP Group
All rights reserved.
Last updated: Wed Jan 29 12:01:24 2020 UTC