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

Edwin Török posted 2 patches 1 year, 2 months ago
Test gitlab-ci failed
Patches applied successfully (tree, apply log)
git fetch https://gitlab.com/xen-project/patchew/xen tags/patchew/cover.1677245356.git.edwin.torok@cloud.com
tools/libs/guest/xg_core_x86.c     | 2 ++
tools/libs/guest/xg_offline_page.c | 7 +++++--
2 files changed, 7 insertions(+), 2 deletions(-)
[PATCH v1 0/2] fix memory leaks reported by GCC -fanalyzer
Posted by Edwin Török 1 year, 2 months ago
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(-)

-- 
2.39.1