From: Peter Krempa Date: Mon, 21 Jul 2014 07:52:02 +0000 (+0200) Subject: examples: domtop: Fix uninitialized variable use X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=abab113bd237c4700190db32e01db352569d9b3f;p=libvirt.git examples: domtop: Fix uninitialized variable use max_id could be used uninitialized in the cleanup section after the domain wasn't found. Discovered by Coverity. --- diff --git a/examples/domtop/domtop.c b/examples/domtop/domtop.c index 8118793a06..7661057b12 100644 --- a/examples/domtop/domtop.c +++ b/examples/domtop/domtop.c @@ -254,7 +254,7 @@ do_top(virConnectPtr conn, { int ret = -1; virDomainPtr dom; - int max_id; + int max_id = 0; int nparams = 0, then_nparams = 0, now_nparams = 0; virTypedParameterPtr then_params = NULL, now_params = NULL; struct sigaction action_stop;