This is the mail archive of the
elfutils-devel@sourceware.org
mailing list for the elfutils project.
[Bug libdw/23301] New: free on unitialized value
- From: "luizluca at gmail dot com" <sourceware-bugzilla at sourceware dot org>
- To: elfutils-devel at sourceware dot org
- Date: Sun, 17 Jun 2018 08:44:58 +0000
- Subject: [Bug libdw/23301] New: free on unitialized value
- Auto-submitted: auto-generated
https://sourceware.org/bugzilla/show_bug.cgi?id=23301
Bug ID: 23301
Summary: free on unitialized value
Product: elfutils
Version: unspecified
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: libdw
Assignee: unassigned at sourceware dot org
Reporter: luizluca at gmail dot com
CC: elfutils-devel at sourceware dot org
Target Milestone: ---
Created attachment 11075
--> https://sourceware.org/bugzilla/attachment.cgi?id=11075&action=edit
patch: dwarf_getsrclines.c: Fix unitialized usage of filelist
I'm getting this error with 0.172:
dwarf_getsrclines.c: In function 'read_srclines':
dwarf_getsrclines.c:1074:7: error: 'filelist' may be used uninitialized in this
function [-Werror=maybe-uninitialized]
free (filelist);
^~~~~~~~~~~~~~~
It seems that gcc is right here as there is "ifs" that go to "out" (where
filelist is freed) before freelist is initialized. I fixed by just moving
filelist initialization to before the first usage of "goto out;". Maybe there
is a more elegant approach.
--
You are receiving this mail because:
You are on the CC list for the bug.