Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: a9070053b7adcac455e38e29440cfe9a7063a6ce
Ticket: 1299803fffffffffffffffffffffffffffffffff
Tcl_SetBignumObj memory leak
User & Date: dgp on 2005-09-23 04:46:39
Changes

  1. assignee changed to: "kennykb"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    
    End of the Tcl_SetBignumObj routine:
    
        /* Clear the value with mp_init; mp_clear
    overwrites the digit array. */
    
        mp_init(bignumValue);
    
    (Same issue in Tcl_NewBignumObj)
    
    The comment suggests that our intent
    is to free the memory of the bignumValue
    passed in, while not freeing the digit array
    that's been transferred to the intrep of
    the Tcl_Obj.  This intent would allow
    callers of Tcl_(Set|New)BignumObj
    to not have to worry about calling mp_clear.
    They can think of these functions as
    transferring ownership of their mp_int
    value to Tcl.
    
    Trouble is that mp_init() allocates
    a minimum-sized digit array of
    MP_PREC mp_digits.  This digit
    array is being leaked.
    
    There's a fix for this on the
    numerics-branch, and these
    routines aren't actually used
    on the HEAD yet.  A better
    numerics branch fix, followed by
    merge onto the HEAD is the
    way forward.
    
    
  4. foundin changed to: "obsolete: 8.5a4"
  5. priority changed to: "5 Medium"
  6. resolution changed to: "None"
  7. status changed to: "Open"
  8. submitter changed to: "dgp"
  9. subsystem changed to: "10. Objects"
  10. title changed to: "Tcl_SetBignumObj memory leak"
  11. type changed to: "Bug"