This service will be undergoing maintenance at 00:00 UTC, 2016-09-28. It is expected to last about 1 hours
Bug 15958 - memory leak in rpmtransCreateSet()
memory leak in rpmtransCreateSet()
Status: CLOSED NOTABUG
Product: Red Hat Raw Hide
Classification: Retired
Component: rpm (Show other bugs)
1.0
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Jeff Johnson
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2000-08-10 18:31 EDT by Timothy D. Prime
Modified: 2008-05-01 11:37 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2000-08-10 18:31:32 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description Timothy D. Prime 2000-08-10 18:31:29 EDT
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 16:08:35 EDT
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.