From: Matthew Daley Date: Wed, 18 Sep 2013 03:37:50 +0000 (+1200) Subject: libxl: only free console reader if it was allocated in main_dmesg X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~6283 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=2e979531e51bafe3dbf9a36546a90176a6bd11e5;p=xen.git libxl: only free console reader if it was allocated in main_dmesg Coverity-ID: 1055304 Signed-off-by: Matthew Daley Acked-by: Ian Campbell --- 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; }