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);
 }
 
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to