[libGD] #196 [Task opened] Possible Memory leak in newDynamic

[email protected] Fri, 3 Apr 2009 23:51:06 +0200 (CEST)
Newsgroups php.gd.bugs
Message-ID <[email protected]>
THIS IS AN AUTOMATED MESSAGE, DO NOT REPLY.

A new Flyspray task has been opened.  Details are below. 

User who did this - Steve Fossen (sfossen) 

Attached to Project - libGD
Summary - Possible Memory leak in newDynamic 
Task Type - Bug Report
Category - Image Import/Export
Status - Unconfirmed
Assigned To - 
Operating System - All
Severity - Low
Priority - Normal
Reported Version - 2.0.36RC1
Due in Version - Undecided
Due Date - Undecided
Details - 
gd_io_dp.c:newDynamic:212


current version 1.15

<code>
/* return data as a dynamic pointer */
static dynamicPtr *newDynamic (int initialSize, void *data, int freeOKFlag)
{
  dynamicPtr *dp;
  dp = (dynamicPtr *) gdMalloc (sizeof (dynamicPtr));
  if(dp == NULL) {
      return NULL;
  }

  if (!allocDynamic (dp, initialSize, data)) {
    return NULL;
  }

  dp->pos = 0;
  dp->freeOK = freeOKFlag;
  return dp;
}
</code>


free dp on failure

<code>
/* return data as a dynamic pointer */
static dynamicPtr *newDynamic (int initialSize, void *data, int freeOKFlag)
{
  dynamicPtr *dp;
  dp = (dynamicPtr *) gdMalloc (sizeof (dynamicPtr));
  if(dp == NULL) {
      return NULL;
  }

  if (!allocDynamic (dp, initialSize, data)) {
    gdFree(dp);
    return NULL;
  }

  dp->pos = 0;
  dp->freeOK = freeOKFlag;
  return dp;
}
</code>


More information can be found at the following URL:
http://bugs.libgd.org/?do=details&task_id=196

You are receiving this message because you have requested it from the Flyspray bugtracking system.  If you did not expect this message or don't want to receive mails in future, you can change your notification settings at the URL shown above.