From mboxrd@z Thu Jan 1 00:00:00 1970 From: Wei Liu Subject: [PATCH for-4.6 04/13] xl: free pid string in do_daemonize Date: Thu, 23 Jul 2015 08:59:05 +0100 Message-ID: <1437638354-14216-5-git-send-email-wei.liu2@citrix.com> References: <1437638354-14216-1-git-send-email-wei.liu2@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1ZIBPW-0004wz-J4 for xen-devel@lists.xenproject.org; Thu, 23 Jul 2015 07:59:22 +0000 In-Reply-To: <1437638354-14216-1-git-send-email-wei.liu2@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Xen-devel Cc: Wei Liu , Ian Jackson , Ian Campbell List-Id: xen-devel@lists.xenproject.org Pid is a null terminated string allocated by asprintf. It should be freed after use. Also fixed a coding style problem while I was there. Signed-off-by: Wei Liu --- tools/libxl/xl_cmdimpl.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c index 5c74a73..bfd8e59 100644 --- a/tools/libxl/xl_cmdimpl.c +++ b/tools/libxl/xl_cmdimpl.c @@ -524,10 +524,12 @@ static int do_daemonize(char *name, const char *pidfile) exit(1); } - if ( close(fd) < 0 ) { + if (close(fd) < 0) { perror("Closing pidfile"); exit(1); } + + free(pid); } out: -- 1.9.1