mbox series

[v1,0/2] fix memory leaks reported by GCC -fanalyzer

Message ID cover.1677245356.git.edwin.torok@cloud.com (mailing list archive)
Headers show
Series fix memory leaks reported by GCC -fanalyzer | expand

Message

Edwin Török Feb. 24, 2023, 1:36 p.m. UTC
From: Edwin Török <edwin.torok@cloud.com>

Using GCC 12.2.1 with -fanalyzer it has shown some memory leaks:

This is how I enabled -fanalyzer (adding it to CFLAGS for toplevel
configure didn't seem to work):

```
CFLAGS += $(call cc-option,$(CC),-fanalyzer)
```

Note that there are more errors shown than fixed here, but they seem to
be false positives (which is why this flag cannot, yet, be enabled by
default).

Edwin Török (2):
  xc_core_arch_map_p2m_tree_rw: fix memory leak
  backup_ptes: fix leak on realloc failure

 tools/libs/guest/xg_core_x86.c     | 2 ++
 tools/libs/guest/xg_offline_page.c | 7 +++++--
 2 files changed, 7 insertions(+), 2 deletions(-)