]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Do not destroy the strpool if NULL
authorPhilippe Waroquiers <philippe.waroquiers@skynet.be>
Sat, 14 Jun 2014 19:09:22 +0000 (19:09 +0000)
committerPhilippe Waroquiers <philippe.waroquiers@skynet.be>
Sat, 14 Jun 2014 19:09:22 +0000 (19:09 +0000)
It is possible that a debug info contains no string (and so strpool
is never allocated).
A protection to avoid accessing strpool was already necessary
in ML_(canonicaliseTables) :
   if (di->strpool)
      VG_(freezeDedupPA) (di->strpool);

So, if a similar debug info is released, we need the same protection
to avoid accessing a NULL strpool.

Detect by Julian on arm64, but not (at least easily) reproduced on amd64.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14033

coregrind/m_debuginfo/debuginfo.c

index a37c228845495e2e7db20df689c28083fdc22234..6e1cacf34fb6c2cf132957268bdb1ea1ca9df2f2 100644 (file)
@@ -229,7 +229,8 @@ static void free_DebugInfo ( DebugInfo* di )
       ML_(dinfo_free)(di->symtab);
    }
 
-   VG_(deleteDedupPA) (di->strpool);
+   if (di->strpool)
+      VG_(deleteDedupPA) (di->strpool);
 
    /* Delete the two admin arrays.  These lists exist primarily so
       that we can visit each object exactly once when we need to