]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
dwarflint: Plug leak (alloca instead of malloc)
authorPetr Machata <pmachata@redhat.com>
Mon, 30 Nov 2009 15:22:47 +0000 (16:22 +0100)
committerPetr Machata <pmachata@redhat.com>
Wed, 18 Aug 2010 12:55:16 +0000 (14:55 +0200)
src/dwarflint/check_debug_loc_range.cc

index 8bc01e9aee965a2f3ead79674bc9ebdbb5aab9c6..23ccdbaecf418eada760c6e5cc550064c31e4974 100644 (file)
@@ -596,7 +596,7 @@ namespace
          = sec->id == sec_loc ? &cu->loc_refs : &cu->range_refs;
        size += rec->size;
       }
-    struct ref_cu *refs = (ref_cu *)xmalloc (sizeof (*refs) * size);
+    struct ref_cu *refs = (ref_cu *)alloca (sizeof (*refs) * size);
     struct ref_cu *refptr = refs;
     for (struct cu *cu = cu_chain; cu != NULL; cu = cu->next)
       {