Bug 120980

Summary: ypserv-2.12.1 has memory leak
Product: Red Hat Enterprise Linux 3 Reporter: Feng Qin <fengqin>
Component: ypservAssignee: Steve Dickson <steved>
Status: CLOSED ERRATA QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 3.0CC: fengqin
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2004-10-14 20:42:37 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 Feng Qin 2004-04-15 20:33:31 UTC
Description of problem:
The memory leak can be triggerred remotely. After the `fast_open_file
[]' cache is full with the opend map file, client requests the maps 
that exist and not exist alternatively, then the memory for those 
maps that not exist will leak. Repeat runs will result in ypserv use 
more and more memory, and running more slowly. Actually, this problem 
is similar to the previous one [RHSA-2002:223-07] reported 
at: "http://www.redhat.com/archives/redhat-announce-list/2002-
October/msg00015.html". But with different inputs

Version-Release number of selected component (if applicable):
prior and up to 2.12.1

How reproducible:
Easy

Steps to Reproduce:
1.modify cached_map_file number in configuration file 'ypserv.conf' 
as follows. "files: 3"
2.send three requests "ypmatch nfsnobody passwd", "ypmatch nfsnobody 
group", "ypmatch nfsnobody rpc" (this is to fill the map file caches)
3.send request map that does not exist, like "ypmatch aaa foooooooooo"
, and request map that exist, like "ypmatch nfsnobody netgroup" 
alternatively.
  
Actual results:
memory used by ypserv more and more

Expected results:
should keep constant

Additional info:
The bug exists in file ./lib/yp_db.c. The leaked memory is allocated 
at line 376 and line 377 and is leaked at line 338 and 339.

Comment 1 Steve Dickson 2004-10-14 20:42:37 UTC
Fixed in ypserv-1.3.9-3.6x