mirror of
https://github.com/openharmony/third_party_elfutils.git
synced 2026-07-19 19:43:34 -04:00
libdwfl: Don't leak fname if file is main file by another name in try_open.
Signed-off-by: Mark Wielaard <mjw@redhat.com>
This commit is contained in:
@@ -1,3 +1,7 @@
|
||||
2015-06-18 Mark Wielaard <mjw@redhat.com>
|
||||
|
||||
* find-debuginfo.c (try_open): Free fname on all failure paths.
|
||||
|
||||
2015-06-18 Mark Wielaard <mjw@redhat.com>
|
||||
|
||||
* dwfl_module_getdwarf.c (find_symtab): Check shdr is not NULL and
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Standard find_debuginfo callback for libdwfl.
|
||||
Copyright (C) 2005-2010, 2014 Red Hat, Inc.
|
||||
Copyright (C) 2005-2010, 2014, 2015 Red Hat, Inc.
|
||||
This file is part of elfutils.
|
||||
|
||||
This file is free software; you can redistribute it and/or modify
|
||||
@@ -62,6 +62,7 @@ try_open (const struct stat64 *main_stat,
|
||||
&& st.st_dev == main_stat->st_dev)
|
||||
{
|
||||
/* This is the main file by another name. Don't look at it again. */
|
||||
free (fname);
|
||||
close (fd);
|
||||
errno = ENOENT;
|
||||
fd = -1;
|
||||
|
||||
Reference in New Issue
Block a user