Bug 117332

Summary: calling free on random pointer value
Product: [Fedora] Fedora Reporter: d.binderman
Component: prelinkAssignee: Jakub Jelinek <jakub>
Status: CLOSED ERRATA QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: rawhide   
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: 0.3.1-1 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2004-03-04 17:37:48 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 d.binderman 2004-03-02 21:33:12 UTC
Description of problem:

I just tried to compile Core2 Test1 package prelink-0.3.0-20

The compiler said

prelink.c(348): remark #592: variable "data" is used before its value
is set

The source code is

         free (data.d_buf);

Calling free on uninit local variable data is deeply unwise.  Suggest init
data.d_buf before first use.



Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.
2.
3.
  
Actual results:


Expected results:


Additional info:

Comment 1 Jakub Jelinek 2004-03-02 22:20:30 UTC
Thanks, fixed in my tree.  Bigger bug is that GCC doesn't warn about
this (only when the variable is not aggregate).  ++todo.

Comment 2 Jay Turner 2004-09-02 05:19:47 UTC
An errata has been issued which should help the problem 
described in this bug report. This report is therefore being 
closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files, 
please follow the link below. You may reopen this bug report 
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2004-386.html