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 891669 - cppcheck error: extras/scsi_id/scsi_id.c: Memory leak: newargv [error]
Summary: cppcheck error: extras/scsi_id/scsi_id.c: Memory leak: newargv [error]
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: udev
Version: 6.4
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Harald Hoyer
QA Contact: Radka Brychtova
URL:
Whiteboard:
Depends On:
Blocks: 1270825
TreeView+ depends on / blocked
 
Reported: 2013-01-03 15:39 UTC by Karel Volný
Modified: 2016-05-11 00:25 UTC (History)
4 users (show)

Fixed In Version: udev-147-2.66.el6
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-05-11 00:25:49 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2016:0903 0 normal SHIPPED_LIVE udev bug fix update 2016-05-10 22:51:07 UTC

Description Karel Volný 2013-01-03 15:39:50 UTC
Description of problem:
trying to run cppcheck on udev package, it reports error in scsi_id.c

Version-Release number of selected component (if applicable):
udev-147-2.43.el6.src.rpm

How reproducible:
always

Steps to Reproduce:
1. rpmbuild -bp udev-147-2.43.el6.src.rpm
2. cd ~/rpmbuild/BUILD/udev-147
3. cppcheck .
  
Actual results:
...
17/50 files checked 27% done
Checking extras/scsi_id/scsi_id.c...
[extras/scsi_id/scsi_id.c:680]: (error) Memory leak: newargv
18/50 files checked 30% done
...

Expected results:
no errors

Additional info:
I do not know how serious is this ... if this is not a bug in udev, then this should be reassigned to cppcheck not to report false positive.

Comment 2 RHEL Program Management 2013-01-07 06:47:18 UTC
This request was not resolved in time for the current release.
Red Hat invites you to ask your support representative to
propose this request, if still desired, for consideration in
the next release of Red Hat Enterprise Linux.

Comment 3 Harald Hoyer 2013-07-03 11:40:15 UTC
int main(int argc, char **argv)
{
...
		if (set_options(udev, newargc, newargv, short_options, maj_min_dev) < 0) {
			retval = 2;
                        free(newargv); // <--------- MISSING
			goto exit;
		}
		free(newargv);
...
}

Comment 4 Michal Sekletar 2015-10-15 13:40:20 UTC
(In reply to Harald Hoyer from comment #3)

>                         free(newargv); // <--------- MISSING

I've merged to my staging branch a different patch, because freeing just newargv is not enough. We also need to free newargv[0] because this is a pointer to buffer which actually hold the arguments. Btw, such patch is also upstream.

While at it, I also merged one more patch which prevents fd leak, also already upstream.

Comment 7 Radka Brychtova 2016-02-05 13:44:53 UTC
Cppcheck is now part of Covscan in Errata-tool.
Cppcheck is clear in version udev-147-2.70.el6.

Comment 9 errata-xmlrpc 2016-05-11 00:25:49 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2016-0903.html


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