From nobody Sun May 5 12:15:06 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1495846881312442.4523515938205; Fri, 26 May 2017 18:01:21 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4EB0B8553D; Sat, 27 May 2017 01:01:18 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id BA16217162; Sat, 27 May 2017 01:01:16 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id DF2A94BB7F; Sat, 27 May 2017 01:01:11 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v4R119kw015676 for ; Fri, 26 May 2017 21:01:10 -0400 Received: by smtp.corp.redhat.com (Postfix) id E39924D74B; Sat, 27 May 2017 01:01:09 +0000 (UTC) Received: from mx1.redhat.com (ext-mx08.extmail.prod.ext.phx2.redhat.com [10.5.110.32]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D9F9217162 for ; Sat, 27 May 2017 01:01:08 +0000 (UTC) Received: from out1.zte.com.cn (out1.zte.com.cn [202.103.147.172]) by mx1.redhat.com (Postfix) with ESMTP id A6B21C057F91 for ; Sat, 27 May 2017 01:01:05 +0000 (UTC) Received: from unknown (HELO mse01.zte.com.cn) (10.30.3.20) by localhost with (AES256-SHA encrypted) SMTP; 27 May 2017 00:40:38 -0000 Received: from notes_smtp.zte.com.cn ([10.30.1.239]) by mse01.zte.com.cn with ESMTP id v4R0sBGH008207 for ; Sat, 27 May 2017 08:54:11 +0800 (GMT-8) (envelope-from wang.yi59@zte.com.cn) Received: from fox-host8.localdomain ([10.74.120.8]) by szsmtp06.zte.com.cn (Lotus Domino Release 8.5.3FP6) with ESMTP id 2017052708541787-73337 ; Sat, 27 May 2017 08:54:17 +0800 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 4EB0B8553D Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=zte.com.cn Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=libvir-list-bounces@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 4EB0B8553D DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com A6B21C057F91 Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=zte.com.cn Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=wang.yi59@zte.com.cn DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com A6B21C057F91 X-scanvirus: By SEG_CYREN AntiVirus Engine X-scanresult: CLEAN X-MAILFROM: X-RCPTTO: X-FROMIP: 10.30.3.20 X-SEG-Scaned: 1 X-Received: unknown,10.30.3.20,20170527084038 From: Yi Wang To: libvir-list@redhat.com Date: Fri, 26 May 2017 21:10:50 -0400 Message-Id: <1495847450-48620-1-git-send-email-wang.yi59@zte.com.cn> X-MIMETrack: Itemize by SMTP Server on SZSMTP06/server/zte_ltd(Release 8.5.3FP6|November 21, 2013) at 2017-05-27 08:54:17, Serialize by Router on notes_smtp/zte_ltd(Release 8.5.3FP6|November 21, 2013) at 2017-05-27 08:53:52, Serialize complete at 2017-05-27 08:53:52 X-MAIL: mse01.zte.com.cn v4R0sBGH008207 X-HQIP: 127.0.0.1 X-Greylist: Delayed for 00:06:39 by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Sat, 27 May 2017 01:01:06 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Sat, 27 May 2017 01:01:06 +0000 (UTC) for IP:'202.103.147.172' DOMAIN:'out1.zte.com.cn' HELO:'out1.zte.com.cn' FROM:'wang.yi59@zte.com.cn' RCPT:'' X-RedHat-Spam-Score: 0.678 (BAYES_50, DCC_REPUT_13_19, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, RP_MATCHES_RCVD, SPF_PASS) 202.103.147.172 out1.zte.com.cn 202.103.147.172 out1.zte.com.cn X-Scanned-By: MIMEDefang 2.78 on 10.5.110.32 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com Cc: Liu.Jianjun3@zte.com.cn, Xi Xu Subject: [libvirt] [PATCH] fix memory leak in daemonUnixSocketPaths and qemuMonitorJSONAttachCharDevCommand X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Sat, 27 May 2017 01:01:19 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" From: Xi Xu The @rundir is allocated in virGetUserRuntimeDirectory, may lost when virFileMakePath failed. The tlsalias allocated in qemuAliasTLSObjFromSrcAlias may lost when append string to json. --- daemon/libvirtd.c | 1 + src/qemu/qemu_monitor_json.c | 2 ++ 2 files changed, 3 insertions(+) diff --git a/daemon/libvirtd.c b/daemon/libvirtd.c index 891238b..2447d78 100644 --- a/daemon/libvirtd.c +++ b/daemon/libvirtd.c @@ -288,6 +288,7 @@ daemonUnixSocketPaths(struct daemonConfig *config, old_umask =3D umask(077); if (virFileMakePath(rundir) < 0) { umask(old_umask); + VIR_FREE(rundir); goto error; } umask(old_umask); diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c index 0837290..66f3f87 100644 --- a/src/qemu/qemu_monitor_json.c +++ b/src/qemu/qemu_monitor_json.c @@ -6481,6 +6481,8 @@ qemuMonitorJSONAttachCharDevCommand(const char *chrID, =20 if (virJSONValueObjectAppendString(data, "tls-creds", tlsalias= ) < 0) goto error; + + VIR_FREE(tlsalias); } break; =20 --=20 1.8.3.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list