From patchwork Fri Jun 4 16:48:13 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dumitru Ceara X-Patchwork-Id: 1487933 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=140.211.166.138; helo=smtp1.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=XRJR8pHM; dkim-atps=neutral Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4FxTH42zWwz9sSn for ; Sat, 5 Jun 2021 02:48:32 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 54EDE8430E; Fri, 4 Jun 2021 16:48:30 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id wAG8zVb89UuL; Fri, 4 Jun 2021 16:48:26 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [IPv6:2605:bc80:3010:104::8cd3:938]) by smtp1.osuosl.org (Postfix) with ESMTP id A2FD3843CE; Fri, 4 Jun 2021 16:48:25 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 728BEC000E; Fri, 4 Jun 2021 16:48:25 +0000 (UTC) X-Original-To: ovs-dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by lists.linuxfoundation.org (Postfix) with ESMTP id 3E172C0001 for ; Fri, 4 Jun 2021 16:48:24 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 28651843CE for ; Fri, 4 Jun 2021 16:48:24 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 1HZrYQkcA4Y7 for ; Fri, 4 Jun 2021 16:48:23 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by smtp1.osuosl.org (Postfix) with ESMTPS id 676E38430E for ; Fri, 4 Jun 2021 16:48:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1622825302; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Wy/Kh7I3n3UHo4mkVtrFp4mCxSSTvy0rpuzoixf+3Qc=; b=XRJR8pHMY1datpMA0oW/pm+J7IS2VmrrE4dOFNRKPuFQA0w9lZO+8u3+Qu+bLt7WGlzUng jOgRi5b2W9BP/aXsyt9VfRb0e5VEKEB/erNeEhRGzUZxNL8C60Zft2dQLPmed66+G8oPra JMb+mUBx80k36J68wkWlARqkwLGZAZU= 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-250-_LHv7zNfMD-2ihzFol4KPw-1; Fri, 04 Jun 2021 12:48:20 -0400 X-MC-Unique: _LHv7zNfMD-2ihzFol4KPw-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 118F2101371C; Fri, 4 Jun 2021 16:48:20 +0000 (UTC) Received: from dceara.remote.csb (ovpn-115-11.ams2.redhat.com [10.36.115.11]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3A76862460; Fri, 4 Jun 2021 16:48:19 +0000 (UTC) From: Dumitru Ceara To: ovs-dev@openvswitch.org Date: Fri, 4 Jun 2021 18:48:13 +0200 Message-Id: <20210604164813.11464-1-dceara@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=dceara@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Subject: [ovs-dev] [PATCH ovn] ovn-northd-ddlog: Fix memleak when destroying context. X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" This is benign but AddressSanitizer was complaining about it: Direct leak of 40 byte(s) in 1 object(s) allocated from: #0 0x7fa93cd6d667 in __interceptor_malloc (/lib64/libasan.so.6+0xb0667) #1 0x1be8d3e in xmalloc__ lib/util.c:137 #2 0x1be8e1a in xmalloc lib/util.c:172 #3 0x1b799d3 in json_create lib/json.c:1451 #4 0x1b74314 in json_integer_create lib/json.c:263 #5 0x1b7d38a in jsonrpc_create_id lib/jsonrpc.c:563 #6 0x1b7d3a5 in jsonrpc_create_request lib/jsonrpc.c:570 #7 0x1b8d851 in ovsdb_cs_send_transaction lib/ovsdb-cs.c:1376 #8 0x40b017 in northd_send_output_only_data_request northd/ovn-northd-ddlog.c:290 #9 0x40c802 in northd_run northd/ovn-northd-ddlog.c:568 #10 0x410225 in main northd/ovn-northd-ddlog.c:1289 #11 0x7fa93c4a9081 in __libc_start_main ../csu/libc-start.c:308 Signed-off-by: Dumitru Ceara Acked-by: Ben Pfaff --- northd/ovn-northd-ddlog.c | 1 + 1 file changed, 1 insertion(+) diff --git a/northd/ovn-northd-ddlog.c b/northd/ovn-northd-ddlog.c index a4f2960bd..444e13e39 100644 --- a/northd/ovn-northd-ddlog.c +++ b/northd/ovn-northd-ddlog.c @@ -206,6 +206,7 @@ northd_ctx_destroy(struct northd_ctx *ctx) { if (ctx) { ovsdb_cs_destroy(ctx->cs); + json_destroy(ctx->request_id); json_destroy(ctx->output_only_data); free(ctx->prefix); free(ctx);