From nobody Sun Feb 8 09:11:37 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) client-ip=207.211.31.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1586782194; cv=none; d=zohomail.com; s=zohoarc; b=Z5gUrIXlh88n2xB8gWk9otdp9XYhZ7R9kbi88HSreriDoueBFMNDZmKjfBBkyfxeRtRyNJrCBEAL3ed3l8gdtvV3lBHR6/0PYLpKJarZWFS8T4Skewh6DcAOV62QcOxZ4gDc6YXJGgYHMh+TX5cxTvaTCezO7Ko4in+QH3aZCrs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1586782194; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:Sender:Subject:To; bh=PmTTp+jWOiVFESKIu3vDTvAajIN23Quq/lpwcqeUiRA=; b=RGfPflsNZiviscQNB+H9rN+Ehs43U3Wz2BjncluBJUv+yUrGw723G77+yjrQiFhtlr9b/8Sqp9pd8Mj1qmXBFFWqDQv+Tg+6h5SeiD2sNRaU9kCeB14ZDG5Gstg9apezXEqOdtVde1ywZaPnnowPvXZ0Bc60zFzivyGnBiHg/Mk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by mx.zohomail.com with SMTPS id 1586782194269344.3939393232905; Mon, 13 Apr 2020 05:49:54 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-391-kpHTt6LdPTa4c8TswxNhzg-1; Mon, 13 Apr 2020 08:49:51 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id A02878017FD; Mon, 13 Apr 2020 12:49:45 +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 2739860BEC; Mon, 13 Apr 2020 12:49:45 +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 21E2993068; Mon, 13 Apr 2020 12:49:44 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 03DCnhpa003516 for ; Mon, 13 Apr 2020 08:49:43 -0400 Received: by smtp.corp.redhat.com (Postfix) id EF6392026D69; Mon, 13 Apr 2020 12:49:42 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast04.extmail.prod.ext.rdu2.redhat.com [10.11.55.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id EB8CB2026D68 for ; Mon, 13 Apr 2020 12:49:40 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-2.mimecast.com [205.139.110.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 8987F101A55F for ; Mon, 13 Apr 2020 12:49:40 +0000 (UTC) Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-214-JRZ1i8CYMjmwJbRJl6ZeIw-1; Mon, 13 Apr 2020 08:49:37 -0400 Received: from pps.filterd (m0098404.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 03DCYO3U032193 for ; Mon, 13 Apr 2020 08:49:37 -0400 Received: from e06smtp01.uk.ibm.com (e06smtp01.uk.ibm.com [195.75.94.97]) by mx0a-001b2d01.pphosted.com with ESMTP id 30b9ymkt6u-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 13 Apr 2020 08:49:36 -0400 Received: from localhost by e06smtp01.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 13 Apr 2020 13:49:02 +0100 Received: from b06avi18626390.portsmouth.uk.ibm.com (9.149.26.192) by e06smtp01.uk.ibm.com (192.168.101.131) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Mon, 13 Apr 2020 13:49:01 +0100 Received: from b06wcsmtp001.portsmouth.uk.ibm.com (b06wcsmtp001.portsmouth.uk.ibm.com [9.149.105.160]) by b06avi18626390.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 03DCmQRd49283566 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 13 Apr 2020 12:48:26 GMT Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 145D4A405B; Mon, 13 Apr 2020 12:49:32 +0000 (GMT) Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 3F2C5A405F; Mon, 13 Apr 2020 12:49:31 +0000 (GMT) Received: from oc2388111647.ibm.com (unknown [9.85.91.210]) by b06wcsmtp001.portsmouth.uk.ibm.com (Postfix) with ESMTPS; Mon, 13 Apr 2020 12:49:31 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1586782193; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:content-type:content-type: content-transfer-encoding:content-transfer-encoding:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=PmTTp+jWOiVFESKIu3vDTvAajIN23Quq/lpwcqeUiRA=; b=XEjyFHz6of1b5c4BAYAL+OoFWrqSWAI/I+JPEE2p9wM+12bDph1PpUDK0if89pwXtNuyJ1 3k+m6FL9bRRJIwu9zI2E/edzfd0NHa3u+EWDvVMQeje4CzZZ68kdfh40Md2PUNOHayCyjb UWqroQnZ+F6jM/1OD/mVIsiNRV9AFw4= X-MC-Unique: kpHTt6LdPTa4c8TswxNhzg-1 X-MC-Unique: JRZ1i8CYMjmwJbRJl6ZeIw-1 From: Seeteena Thoufeek To: libvir-list@redhat.com Subject: [PATCH] libvirt-stream.c: Use g_autofree Date: Mon, 13 Apr 2020 18:19:26 +0530 X-TM-AS-GCONF: 00 x-cbid: 20041312-4275-0000-0000-000003BF0CA7 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 20041312-4276-0000-0000-000038D47B14 Message-Id: <1586782166-32717-1-git-send-email-s1seetee@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.138, 18.0.676 definitions=2020-04-13_05:2020-04-13, 2020-04-13 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 clxscore=1015 priorityscore=1501 phishscore=0 lowpriorityscore=0 impostorscore=0 spamscore=0 mlxlogscore=456 malwarescore=0 suspectscore=3 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2003020000 definitions=main-2004130092 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id 03DCnhpa003516 X-loop: libvir-list@redhat.com Cc: s1seetee@linux.vnet.ibm.com 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: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Mimecast-Spam-Score: 2 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Seeteena Thoufeek Reviewed-by: Erik Skultety --- src/libvirt-stream.c | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/src/libvirt-stream.c b/src/libvirt-stream.c index 6f6bb5d..41b9cc1 100644 --- a/src/libvirt-stream.c +++ b/src/libvirt-stream.c @@ -573,7 +573,7 @@ virStreamSendAll(virStreamPtr stream, virStreamSourceFunc handler, void *opaque) { - char *bytes =3D NULL; + g_autofree char *bytes =3D NULL; size_t want =3D VIR_NET_MESSAGE_LEGACY_PAYLOAD_MAX; int ret =3D -1; VIR_DEBUG("stream=3D%p, handler=3D%p, opaque=3D%p", stream, handler, o= paque); @@ -616,8 +616,6 @@ virStreamSendAll(virStreamPtr stream, ret =3D 0; =20 cleanup: - VIR_FREE(bytes); - if (ret !=3D 0) { virErrorPtr orig_err; =20 @@ -706,7 +704,7 @@ int virStreamSparseSendAll(virStreamPtr stream, virStreamSourceSkipFunc skipHandler, void *opaque) { - char *bytes =3D NULL; + g_autofree char *bytes =3D NULL; size_t bufLen =3D VIR_NET_MESSAGE_LEGACY_PAYLOAD_MAX; int ret =3D -1; unsigned long long dataLen =3D 0; @@ -787,8 +785,6 @@ int virStreamSparseSendAll(virStreamPtr stream, ret =3D 0; =20 cleanup: - VIR_FREE(bytes); - if (ret !=3D 0) { virErrorPtr orig_err; =20 @@ -847,7 +843,7 @@ virStreamRecvAll(virStreamPtr stream, virStreamSinkFunc handler, void *opaque) { - char *bytes =3D NULL; + g_autofree char *bytes =3D NULL; size_t want =3D VIR_NET_MESSAGE_LEGACY_PAYLOAD_MAX; int ret =3D -1; VIR_DEBUG("stream=3D%p, handler=3D%p, opaque=3D%p", stream, handler, o= paque); @@ -892,8 +888,6 @@ virStreamRecvAll(virStreamPtr stream, ret =3D 0; =20 cleanup: - VIR_FREE(bytes); - if (ret !=3D 0) { virErrorPtr orig_err; =20 @@ -964,7 +958,7 @@ virStreamSparseRecvAll(virStreamPtr stream, virStreamSinkHoleFunc holeHandler, void *opaque) { - char *bytes =3D NULL; + g_autofree char *bytes =3D NULL; size_t want =3D VIR_NET_MESSAGE_LEGACY_PAYLOAD_MAX; const unsigned int flags =3D VIR_STREAM_RECV_STOP_AT_HOLE; int ret =3D -1; @@ -1025,8 +1019,6 @@ virStreamSparseRecvAll(virStreamPtr stream, ret =3D 0; =20 cleanup: - VIR_FREE(bytes); - if (ret !=3D 0) { virErrorPtr orig_err; =20 --=20 1.8.3.1