From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Campbell Subject: Re: New Defects reported by Coverity Scan for XenProject Date: Thu, 2 Apr 2015 15:32:44 +0100 Message-ID: <1427985164.4037.82.camel@citrix.com> References: <551be9e0474d8_2970d1331454394@scan.coverity.com.mail> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <551be9e0474d8_2970d1331454394@scan.coverity.com.mail> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Charles Arnold Cc: xen-devel List-Id: xen-devel@lists.xenproject.org Hi Charles, I'm not sure if this is a real issue in the qdisk support for xenstat, but I think it may relate to the first return 0 in qmp_read which may not free the accumulated array. Could you take a look please? Ian. On Wed, 2015-04-01 at 05:51 -0700, scan-admin@coverity.com wrote: > Hi, > > Please find the latest report on new defect(s) introduced to XenProject found with Coverity Scan. > > 1 new defect(s) introduced to XenProject found with Coverity Scan. > 2 defect(s), reported by Coverity Scan earlier, were marked fixed in the recent build analyzed by Coverity Scan. > > New defect(s) Reported-by: Coverity Scan > Showing 1 of 1 defect(s) > > > ** CID 1292691: Resource leaks (RESOURCE_LEAK) > /tools/xenstat/libxenstat/src/xenstat_qmp.c: 327 in qmp_query() > > > ________________________________________________________________________________________________________ > *** CID 1292691: Resource leaks (RESOURCE_LEAK) > /tools/xenstat/libxenstat/src/xenstat_qmp.c: 327 in qmp_query() > 321 int n; > 322 > 323 n = strlen(cmd); > 324 if (qmp_write(qfd, cmd, n) != n) > 325 return NULL; > 326 if (!qmp_read(qfd, &qstats)) > >>> CID 1292691: Resource leaks (RESOURCE_LEAK) > >>> Variable "qstats" going out of scope leaks the storage it points to. > 327 return NULL; > 328 return qstats; > 329 } > 330 > 331 /* Returns a socket connected to the QMP socket. Returns -1 on failure. */ > 332 static int qmp_connect(char *path) > > > ________________________________________________________________________________________________________ > To view the defects in Coverity Scan visit, https://scan.coverity.com/projects/606?tab=overview > > To manage Coverity Scan email notifications for "ian.campbell@citrix.com", click https://scan.coverity.com/subscriptions/edit?email=ian.campbell%40citrix.com&token=1ce0fc428b9f94f66fd8d1ecf6cbb76a . >