RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 985256 - Rsyslog (5.8.10-2.el6) memory leak
Summary: Rsyslog (5.8.10-2.el6) memory leak
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: rsyslog
Version: 6.4
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: rc
: ---
Assignee: Tomas Heinrich
QA Contact: BaseOS QE Security Team
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-07-17 08:07 UTC by gregory.nuyttens
Modified: 2016-09-20 04:51 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-07-24 11:45:13 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description gregory.nuyttens 2013-07-17 08:07:37 UTC
Description of problem:
In rsyslog we can resets all configuration variables to their default value with the global value $ResetConfigVariables but in the module code of imfile we have that (rsyslog-5.8.10-6.el6.src.rpm) we have that:

static rsRetVal resetConfigVariables(uchar __attribute__((unused)) *pp, void __attribute__((unused)) *pVal)
{
	DEFiRet;

	if(pszFileName != NULL) {
		free(pszFileName);
		pszFileName = NULL;
	}

	if(pszFileTag != NULL) {
		free(pszFileTag);
		pszFileTag = NULL;
	}	
  
	if(pszStateFile != NULL) {
		free(pszFileTag);
		pszFileTag = NULL;
	}


	/* set defaults... */
	iPollInterval = 10;
	iFacility = 128; /* local0 */
	iSeverity = 5;  /* notice, as of rfc 3164 */
	readMode = 0;
	pBindRuleset = NULL;

	RETiRet;
}

where 
	if(pszStateFile != NULL) {
		free(pszFileTag);
		pszFileTag = NULL;
	}

seems to be a copy/paste error. 

Version-Release number of selected component (if applicable):
All 5.* versions (also be reproducible on Redhat Enterprise Linux 5 with package rsyslog5)

Actual results:
	if(pszStateFile != NULL) {
		free(pszFileTag);
		pszFileTag = NULL;
	}

Expected results:
	if(pszStateFile != NULL) {
		free(pszStateFile);
		pszStateFile = NULL;
	}

===================
Grégory Nuyttens
Smals - Linux System Engineer
Tel +32 2/787 58 79

Comment 2 Tomas Heinrich 2013-07-23 15:50:17 UTC
Hello Gregory, thanks for the report.

The code is clearly wrong, but I can't see the leak in valgrind. From looking at the code it seems that there's now way the value can be leaked. There's one possible negative side effect that a subsequent $InputRunFileMonitor would reuse the value used in the previous one if no other value is defined, but that can be considered an error in the configuration.

So I'm inclined not to patch this as not to break something else. Do you experience some negative effects of the current status?

Comment 3 gregory.nuyttens 2013-07-24 08:00:55 UTC
Hi Tomas,

I'm agree with you and I don't have at this time bad experience about this *bug*.
If I encounter some negative effects, I will come back to you :-)

I believe that we can consider this report only for a "better" code in next versions.

Thanks for your consideration.

Comment 4 Tomas Heinrich 2013-07-24 11:45:13 UTC
Thanks for confirmation. Feel free to reopen if anything pops up.


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