[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[netCDF #AMN-318885]: Possible memory leak in ncgen

This archive contains answers to questions sent to Unidata support through mid-2025. Note that the archive is no longer being updated. We provide the archive for reference; many of the answers presented here remain technically correct, even if somewhat outdated. For the most up-to-date information on the use of NSF Unidata software and data services, please consult the Software Documentation first.


  • Subject: [netCDF #AMN-318885]: Possible memory leak in ncgen
  • Date: Thu, 30 Aug 2012 11:46:16 -0600

This was assigned Jira Number NCF-195
(https://www.unidata.ucar.edu/jira/browse/NCF-195).
It has been fixed and will appear in the snapshot
available tomorrow.

If you want to fix it yourself.
Edit the file ncgen/bytebuffer.c

and replace the function bbSetlength()
with this code:

int
bbSetlength(Bytebuffer* bb, const unsigned int sz)
{
  if(bb == NULL) return bbFail();
  if(bb->length < sz) {
      if(!bbSetalloc(bb,sz)) return bbFail();
  }
  bb->length = sz;
  return TRUE;
}



=Dennis Heimbigner
  Unidata


Ticket Details
===================
Ticket ID: AMN-318885
Department: Support netCDF
Priority: Normal
Status: Closed