From 2e979531e51bafe3dbf9a36546a90176a6bd11e5 Mon Sep 17 00:00:00 2001 From: Matthew Daley Date: Wed, 18 Sep 2013 15:37:50 +1200 Subject: libxl: only free console reader if it was allocated in main_dmesg Coverity-ID: 1055304 Signed-off-by: Matthew Daley Acked-by: Ian Campbell --- tools/libxl/xl_cmdimpl.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'tools') diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c index 81ec66c85f..642b130864 100644 --- a/tools/libxl/xl_cmdimpl.c +++ b/tools/libxl/xl_cmdimpl.c @@ -5537,7 +5537,8 @@ int main_dmesg(int argc, char **argv) printf("%s", line); finish: - libxl_xen_console_read_finish(ctx, cr); + if (cr) + libxl_xen_console_read_finish(ctx, cr); return ret; } -- cgit v1.2.3