Bug 15958 - memory leak in rpmtransCreateSet()
Summary: memory leak in rpmtransCreateSet()
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Raw Hide
Classification: Retired
Component: rpm
Version: 1.0
Hardware: i386
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Jeff Johnson
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2000-08-10 22:31 UTC by Timothy D. Prime
Modified: 2008-05-01 15:37 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2000-08-10 22:31:32 UTC
Embargoed:


Attachments (Terms of Use)

Description Timothy D. Prime 2000-08-10 22:31:29 UTC
space is allocated for a "temporary" string to append "/"
after it is duplicated, the only reference to the new memory falls of the 
stack when the function exits

this is in rpm-4.0-55/lib/depends.c

Comment 1 Jeff Johnson 2000-08-15 20:08:35 UTC
If you are referring to (from lib/depends.c):
...
    /* This canonicalizes the root */
    rootLen = strlen(rootDir);
    if (!(rootLen && rootDir[rootLen - 1] == '/')) {
        char * t;

        t = alloca(rootLen + 2);
        *t = '\0';
        (void) stpcpy( stpcpy(t, rootDir), "/");
        rootDir = t;
    }

this is alloca's, not malloc'd, memory that is released on return.


Note You need to log in before you can comment on or make changes to this bug.