Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2001-03-24
22:23 • Ticket [403755ffff] Memory leak in Tcl_Import function (file=tclNamesp.c) st... artifact: 46cb89eaf1 user: dgp
08:16 • Closed ticket [403755ffff]. artifact: 7a3927a9d7 user: hobbs
2001-02-22
07:19 • Ticket [403755ffff]: 1 change artifact: 2551095e68 user: dgp
2001-02-14
09:26 • Ticket [403755ffff]: 5 changes artifact: 510b1462f9 user: hobbs
2001-02-13
03:58 • Add attachment None to ticket [403755ffff] artifact: be9799a061 user: hemanglavana
2001-02-12
20:58 • New ticket [403755ffff] Memory leak in Tcl_Import function (file=tclNamesp.c)</i... artifact: 0c4997657f user: hemanglavana

Memory leak in Tcl_Import function (file=tclNamesp.c)

Closed / Accepted403755ffffffffffffffffffffffffffffffffffCreated 26 years agoUpdated 26 years ago
Descriptionplain2001-02-12 20:58:41
In Tcl_Import function, the following variable is initialized but never freed:

                Tcl_DString ds;
                Tcl_DStringInit(&ds);
                Tcl_DStringAppend(&ds, nsPtr->fullName, -1);
                  ...

This will result in memory leak. The attached  patch fixes this problem.

Note that the patch is similar to the  Tcl_DStringFree(&ds) call found in
Tcl_ProcObjCmd function in tclProc.c file.

Thanks,
Hemang.
hobbsplain2001-02-14 09:26:38
It does indeed seem to be the case that the DString
initialized in that block is never freed.  I'm surprised
that Purify never picked up this leak.  This looks to be
in the path of 'namespace import'.
dgp Ticket [403755ffff]: 1 change [History diff]2001-02-22 07:19:02
hobbsplain2001-03-24 08:16:52
Logged In: YES 
user_id=72656

Added to 8.4a2 sources 23 Mar 2001.
dgp Ticket [403755ffff]: 3 changes [History diff]2001-03-24 22:23:29
Log in (anonymous is fine) to add a comment.

Attachments: