]> git.eshelyaron.com Git - emacs.git/commitdiff
Ignore another memory leak
authorPaul Eggert <eggert@cs.ucla.edu>
Mon, 3 Aug 2020 22:21:59 +0000 (15:21 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Tue, 4 Aug 2020 02:08:58 +0000 (19:08 -0700)
* src/pdumper.c (dump_mmap_contiguous_heap):
Ignore the heap control block when checking for leaks.

src/pdumper.c

index 865ceff6fff3f0ef1dafe005fa7df8f59c249adb..63ee0fcb7f6cb815b62b48a03d543fdacafbaa7b 100644 (file)
@@ -4680,15 +4680,15 @@ dump_mmap_contiguous_heap (struct dump_memory_map *maps, int nr_maps,
      Beware: the simple patch 2019-03-11T15:20:54Z!eggert@cs.ucla.edu
      is worse, as it sometimes frees this storage twice.  */
   struct dump_memory_map_heap_control_block *cb = calloc (1, sizeof (*cb));
-
-  char *mem;
   if (!cb)
     goto out;
+  __lsan_ignore_object (cb);
+
   cb->refcount = 1;
   cb->mem = malloc (total_size);
   if (!cb->mem)
     goto out;
-  mem = cb->mem;
+  char *mem = cb->mem;
   for (int i = 0; i < nr_maps; ++i)
     {
       struct dump_memory_map *map = &maps[i];