xl: free bitmaps on exit
authorOlaf Hering <olaf@aepfle.de>
Wed, 28 Nov 2018 12:24:34 +0000 (13:24 +0100)
committerWei Liu <wei.liu2@citrix.com>
Fri, 30 Nov 2018 12:37:52 +0000 (12:37 +0000)
commit89bfc1effdf1aaaaa10b7c9f3d584c8a431dcd65
treea687a11c1b7c913d9eda7ef99de5027ec5aae823
parent2634b997afabfdc5a972e07e536dfbc6febb4385
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. And since xl_ctx_free might be called before
parse_global_config, also move the libxl_bitmap_init calls into
xl_ctx_alloc.

Also move the call to atexit() after xl_ctx_alloc, because the latter is
also called again in postfork.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Wei Liu <wei.liu2@citrix.com>
tools/xl/xl.c