Date: Tue, 4 Feb 2020 21:15:11 +0000 (UTC) From: Mark Johnston <markj@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r357533 - head/contrib/elftoolchain/libdwarf Message-ID: <202002042115.014LFB9Z018849@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: markj Date: Tue Feb 4 21:15:11 2020 New Revision: 357533 URL: https://svnweb.freebsd.org/changeset/base/357533 Log: libdwarf: Make an out-pointer of _dwarf_abbrev_add() mandatory. All callers pass a non-NULL pointer, and otherwise it was possible to leak memory if the abbrev was not added to a CU. CID: 1193365 MFC after: 1 week Sponsored by: The FreeBSD Foundation Modified: head/contrib/elftoolchain/libdwarf/libdwarf_abbrev.c Modified: head/contrib/elftoolchain/libdwarf/libdwarf_abbrev.c ============================================================================== --- head/contrib/elftoolchain/libdwarf/libdwarf_abbrev.c Tue Feb 4 21:14:53 2020 (r357532) +++ head/contrib/elftoolchain/libdwarf/libdwarf_abbrev.c Tue Feb 4 21:15:11 2020 (r357533) @@ -59,9 +59,7 @@ _dwarf_abbrev_add(Dwarf_CU cu, uint64_t entry, uint64_ HASH_ADD(ab_hh, cu->cu_abbrev_hash, ab_entry, sizeof(ab->ab_entry), ab); - if (abp != NULL) - *abp = ab; - + *abp = ab; return (DW_DLE_NONE); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202002042115.014LFB9Z018849>