Bug 10942

Summary: catopen leaking memory
Product: [Retired] Red Hat Linux Reporter: rh
Component: gccAssignee: David Lawrence <dkl>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: high Docs Contact:
Priority: high    
Version: 6.0CC: matt.domencic
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2000-05-10 21:46:40 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description rh 2000-04-20 13:56:10 UTC
It appears that the catopen function is leaking memory.
If you place a catopen call inside of a while(1) memory
is leaked.  Checked this using memprof.

Comment 1 Brock Organ 2000-05-09 17:41:59 UTC
Verified this behavior in 6.0; this does not fail in 6.2 (latest release)...

attached is the sample code to reproduce this (thanks to the folks who provided
it ...!):

g++  -g -Wall -c leak.cpp
g++  -o leak leak.o

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <nl_types.h>

void leak()
{
        char      domainpath[1024];// Domain of resource
        nl_catd catfd;                  // File Descriptor for Catalogue

	memset(domainpath,0,1024);
	catfd=0;

	strcpy(domainpath,"ivbas15.mo");
	if ((catfd=catopen ((char *)domainpath, 0)) > 0) {
                int ii=catclose (catfd);
	}
}

// main program
int main()
{

while(1)
  {
	leak();
    sleep(1);
  }


}

Comment 2 matt.domencic 2000-05-09 17:58:59 UTC
Could you do an rpm -qa > rpmlist on the system that
does not leak for catopen and e-mail it to me.

Thanks,
Matt Domencic
Merant