xl: free bitmaps on exit
PATCH 1/1 xl: free bitmaps on exit
Every invocation of xl via valgrind will show three leaks. Since libxl_bitmap_alloc uses NOGC, the caller has to free the memory after use.
--- tools/xl/xl.c | 3 +++ 1 file changed, 3 insertions(+)
tools/xl/xl.c +3 -0
@@ -229,6 +229,9 @@ static void parse_global_config(const char *configfile,else libxl_bitmap_set_any (&global_pv_affinity_mask); +libxl_bitmap_dispose (&global_pv_affinity_mask); +libxl_bitmap_dispose (&global_hvm_affinity_mask); +libxl_bitmap_dispose (&global_vm_affinity_mask);xlu_cfg_destroy (config); }
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
Am Mon, 26 Nov 2018 15:58:22 +0100
schrieb Olaf Hering <[email protected]>:
Review static void parse_global_config(const char *configfile,
Quoted 2 lines
+++
b/tools/xl/xl.c(quoted diff) +0
-0@@ -229,6 +229,9 @@ static void parse_global_config(const char *configfile,
Actually I think that should go to xl_ctx_free() instead. I moved it down to parse_global_config() by accident.
Olaf
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
Quoted 7 lines · Olaf Hering
Am Mon, 26 Nov 2018 15:58:22 +0100
schrieb Olaf Hering <[email protected]>:Review static void parse_global_config(const char *configfile,
Quoted 2 lines
+++
b/tools/xl/xl.c(quoted diff) +0
-0@@ -229,6 +229,9 @@ static void parse_global_config(const char *configfile,Actually I think that should go to
xl_ctx_free()instead. I moved it down toparse_global_config()by accident.
You can't just put the _dispose into xl_ctx_free. Because xl_ctx_free can be called before calling parse_global_config. You also need to put the _init calls into xl_ctx_alloc.
Wei.
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel