diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/pdumper.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/pdumper.c b/src/pdumper.c index 5bc5bb47f4c..3facd523e4a 100644 --- a/src/pdumper.c +++ b/src/pdumper.c | |||
| @@ -4623,9 +4623,7 @@ dump_mmap_reset (struct dump_memory_map *map) | |||
| 4623 | { | 4623 | { |
| 4624 | map->mapping = NULL; | 4624 | map->mapping = NULL; |
| 4625 | map->release = NULL; | 4625 | map->release = NULL; |
| 4626 | void *private = map->private; | ||
| 4627 | map->private = NULL; | 4626 | map->private = NULL; |
| 4628 | free (private); | ||
| 4629 | } | 4627 | } |
| 4630 | 4628 | ||
| 4631 | static void | 4629 | static void |
| @@ -4648,7 +4646,10 @@ dump_mm_heap_cb_release (struct dump_memory_map_heap_control_block *cb) | |||
| 4648 | { | 4646 | { |
| 4649 | eassert (cb->refcount > 0); | 4647 | eassert (cb->refcount > 0); |
| 4650 | if (--cb->refcount == 0) | 4648 | if (--cb->refcount == 0) |
| 4651 | free (cb->mem); | 4649 | { |
| 4650 | free (cb->mem); | ||
| 4651 | free (cb); | ||
| 4652 | } | ||
| 4652 | } | 4653 | } |
| 4653 | 4654 | ||
| 4654 | static void | 4655 | static void |
| @@ -4663,7 +4664,12 @@ dump_mmap_contiguous_heap (struct dump_memory_map *maps, int nr_maps, | |||
| 4663 | size_t total_size) | 4664 | size_t total_size) |
| 4664 | { | 4665 | { |
| 4665 | bool ret = false; | 4666 | bool ret = false; |
| 4667 | |||
| 4668 | /* FIXME: This storage sometimes is never freed. | ||
| 4669 | Beware: the simple patch 2019-03-11T15:20:54Z!eggert@cs.ucla.edu | ||
| 4670 | is worse, as it sometimes frees this storage twice. */ | ||
| 4666 | struct dump_memory_map_heap_control_block *cb = calloc (1, sizeof (*cb)); | 4671 | struct dump_memory_map_heap_control_block *cb = calloc (1, sizeof (*cb)); |
| 4672 | |||
| 4667 | char *mem; | 4673 | char *mem; |
| 4668 | if (!cb) | 4674 | if (!cb) |
| 4669 | goto out; | 4675 | goto out; |