From patchwork Thu May 10 17:44:59 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 135426 Delivered-To: patch@linaro.org Received: by 10.46.151.6 with SMTP id r6csp1307195lji; Thu, 10 May 2018 10:51:33 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpe9ISSHdtmB+FDYV8SeIT2NXsZUduXh3ku0h9QqU9on1zBSdZ0PhMlk3NDlY24sLZr7pF7 X-Received: by 2002:a0c:bd9a:: with SMTP id n26-v6mr2208979qvg.141.1525974693248; Thu, 10 May 2018 10:51:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525974693; cv=none; d=google.com; s=arc-20160816; b=ePWjcFGDfZZndJmlq3vi//5dv1EXComk7/6ZJdBqrh3ZnFz29Z7gJQnzhWMy504hrH n08uIxKWI+YNsD44EsE/TDDTAttT6ZHtFz0k5R9idITF5s5r75GKWI/vvm49S5cENVHb aaztVsxv58s/9/Ry183OGGzYktEa5t3XphTcB8uEVHeo7T6o/gDg+MVoel88Vfz2r/9T KmswI33CT5YSO7sVlgbub3E3+XraMxaBWkd49pHG6aJbyiVzmEGGarAT2ZfkB0EWcEs1 abCw4X4seq4A6NnAgjDdQ+hOyreXpBKwAjLd4lmZYSbxKVlaNdjUcH5+7dol6GjwLZS/ jHoQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from:arc-authentication-results; bh=m8Ap00DwAUxtbxRFTGOgJ++AN+Ccr9s1HZN5Zo8z+Lw=; b=kyVwZjEiojneGKTwG2ddiBWL1es6DX09raog2O6tlNLx7Sbcz8WLpM7mDNz4rK9nPI Z8nLJbishbUc+mYFTQWo3dFAnncAp7NIv50YcGLQzGZcKDG9reCL1iBs2toE+pnF6S5/ DA5tUi/x9D9Ax1nfHKds/ulssqrJmj3Ol1vMoV2K5HAYjWLv8Nqlr9QtJklDl9uhpQuj gryfyL0Sqz5pmEoS21t4PpAur1ysJKToCLJZargn26RiQoffF2kZNoa4ciUH4JoQ4ptu 6Bz87lt5rlH8oeFEtWfGEcn/qazuttagxTdtFCEAcf07PMi0m6uPvQFmHSk/R9o2DbBs RLfQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id k7-v6si1320133qtk.139.2018.05.10.10.51.32 for (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 10 May 2018 10:51:33 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:34998 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fGpj2-0003qi-Am for patch@linaro.org; Thu, 10 May 2018 13:51:32 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48409) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fGpd8-0004yI-A7 for qemu-devel@nongnu.org; Thu, 10 May 2018 13:45:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fGpd7-0000ok-9N for qemu-devel@nongnu.org; Thu, 10 May 2018 13:45:26 -0400 Received: from orth.archaic.org.uk ([2001:8b0:1d0::2]:41594) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fGpd6-0000mP-Fx for qemu-devel@nongnu.org; Thu, 10 May 2018 13:45:24 -0400 Received: from pm215 by orth.archaic.org.uk with local (Exim 4.89) (envelope-from ) id 1fGpd2-0003T9-QV for qemu-devel@nongnu.org; Thu, 10 May 2018 18:45:20 +0100 From: Peter Maydell To: qemu-devel@nongnu.org Date: Thu, 10 May 2018 18:44:59 +0100 Message-Id: <20180510174519.11264-2-peter.maydell@linaro.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180510174519.11264-1-peter.maydell@linaro.org> References: <20180510174519.11264-1-peter.maydell@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2001:8b0:1d0::2 Subject: [Qemu-devel] [PULL 01/21] hw/arm/iotkit.c: fix minor memory leak X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Coverity (CID1390573) spots that we forgot to free the gpioname strings in a loop in the iotkit realize function. Correct the error. This isn't a significant leak, because this function only ever runs once. Signed-off-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Peter Xu Message-id: 20180427110137.19304-1-peter.maydell@linaro.org --- hw/arm/iotkit.c | 1 + 1 file changed, 1 insertion(+) -- 2.17.0 diff --git a/hw/arm/iotkit.c b/hw/arm/iotkit.c index c5f0a5b98a..234185e8f7 100644 --- a/hw/arm/iotkit.c +++ b/hw/arm/iotkit.c @@ -517,6 +517,7 @@ static void iotkit_realize(DeviceState *dev, Error **errp) qdev_get_gpio_in(DEVICE(&s->ppc_irq_orgate), i)); qdev_connect_gpio_out_named(DEVICE(ppc), "irq", 0, qdev_get_gpio_in(devs, 0)); + g_free(gpioname); } iotkit_forward_sec_resp_cfg(s);