From patchwork Thu Jun 7 02:00:33 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Stewart X-Patchwork-Id: 163693 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from maxx.maxx.shmoo.com (maxx.shmoo.com [205.134.188.171]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "maxx.shmoo.com", Issuer "CA Cert Signing Authority" (not verified)) by ozlabs.org (Postfix) with ESMTPS id 8C9A8B6FAB for ; Fri, 8 Jun 2012 09:27:08 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id F14569D284; Thu, 7 Jun 2012 19:27:03 -0400 (EDT) X-Virus-Scanned: amavisd-new at maxx.shmoo.com Received: from maxx.maxx.shmoo.com ([127.0.0.1]) by localhost (maxx.shmoo.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id LFacsV81fSYB; Thu, 7 Jun 2012 19:27:03 -0400 (EDT) Received: from maxx.shmoo.com (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id DBC2F9D286; Thu, 7 Jun 2012 19:26:59 -0400 (EDT) X-Original-To: mailman-post+hostap@maxx.shmoo.com Delivered-To: mailman-post+hostap@maxx.shmoo.com Received: from localhost (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id B19389D286 for ; Thu, 7 Jun 2012 19:26:58 -0400 (EDT) X-Virus-Scanned: amavisd-new at maxx.shmoo.com Received: from maxx.maxx.shmoo.com ([127.0.0.1]) by localhost (maxx.shmoo.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id W+T+b1BA9x5k for ; Thu, 7 Jun 2012 19:26:55 -0400 (EDT) Received: from mail-wg0-f74.google.com (mail-wg0-f74.google.com [74.125.82.74]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority" (not verified)) by maxx.maxx.shmoo.com (Postfix) with ESMTPS id 082859D284 for ; Thu, 7 Jun 2012 19:26:54 -0400 (EDT) Received: by wgbdt11 with SMTP id dt11so76709wgb.5 for ; Thu, 07 Jun 2012 16:26:53 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=in-reply-to:references:from:date:subject:to:message-id :x-gm-message-state; bh=lUqQemX3AvyjhslLNNOkc1qIpqQn7t9xDYLIpGlRp+A=; b=IRQbhSBgCTKc5GfhMb6hwhdmGA0ua9ta+NObko5S/tUxOXVeHIewx6kEFagzW9k5Hw 7p90w1zwVLZs+NNhLESv4Z91UGFtHRdaa+hZcG3SqhX2kHUF39Icq9yYyeoZNyrplA/n oVtBY0B2lREdDiJdNl8ByEs9615h6xx0Deufo47OT3Lgdj78t6JdnckB3fle3E4S2DDJ D4F16qMZjk3LaIdx++IRuVptgoP3HSoCYdETAkj6RdsPYYdgzxBoqeqHoL7BwAhQEwsg bxwaXvoHq2Vz0eULCoUFEhhFWy2fcTQwIfmX/uRCRKCmag5kCQVpcLcMY70ywKyYcPFg X8NQ== Received: by 10.14.101.2 with SMTP id a2mr1511039eeg.6.1339111613833; Thu, 07 Jun 2012 16:26:53 -0700 (PDT) Received: by 10.14.101.2 with SMTP id a2mr1511034eeg.6.1339111613710; Thu, 07 Jun 2012 16:26:53 -0700 (PDT) Received: from hpza9.eem.corp.google.com ([74.125.121.33]) by gmr-mx.google.com with ESMTPS id v14si4348403eef.2.2012.06.07.16.26.53 (version=TLSv1/SSLv3 cipher=AES128-SHA); Thu, 07 Jun 2012 16:26:53 -0700 (PDT) Received: from glenhelen.mtv.corp.google.com (glenhelen.mtv.corp.google.com [172.22.72.223]) by hpza9.eem.corp.google.com (Postfix) with ESMTP id 7EAFE5C0050 for ; Thu, 7 Jun 2012 16:26:53 -0700 (PDT) Received: by glenhelen.mtv.corp.google.com (Postfix, from userid 110058) id B1CD420462; Thu, 7 Jun 2012 16:26:52 -0700 (PDT) In-Reply-To: <20120607021318.7F49820432@glenhelen.mtv.corp.google.com> References: <20120607021318.7F49820432@glenhelen.mtv.corp.google.com> From: Paul Stewart Date: Wed, 6 Jun 2012 19:00:33 -0700 Subject: [PATCHv2] Fix a couple memory leaks To: hostap@lists.shmoo.com Message-Id: <20120607232652.B1CD420462@glenhelen.mtv.corp.google.com> X-Gm-Message-State: ALoCoQl0tYVCHKG2G4bJcd6+CuY4UEXqe0mU7aY8wJrga5sHpxAimlLMAVWzDk5RmpYj5DNBWDPy6y8ZmQVg4E6VzN3ZpzPIzPWtji0CuxBc5igF6r95cuAmBJq/oB9aeWCVCOPj5qTChOkIBZpyFuLbxc7VfA6ePj90Lva//wY8moaooRJIUHI= X-BeenThere: hostap@lists.shmoo.com X-Mailman-Version: 2.1.9 Precedence: list List-Id: HostAP Project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: hostap-bounces@lists.shmoo.com Errors-To: hostap-bounces@lists.shmoo.com Found using valgrind. Signed-hostap: Paul Stewart --- src/drivers/driver_nl80211.c | 5 +++-- wpa_supplicant/dbus/dbus_new_handlers.c | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c index 92a7de0..67bff35 100644 --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c @@ -8397,18 +8397,19 @@ static int nl80211_signal_monitor(void *priv, int threshold, int hysteresis) cqm = nlmsg_alloc(); if (cqm == NULL) - return -1; + goto nla_put_failure; NLA_PUT_U32(cqm, NL80211_ATTR_CQM_RSSI_THOLD, threshold); NLA_PUT_U32(cqm, NL80211_ATTR_CQM_RSSI_HYST, hysteresis); nla_put_nested(msg, NL80211_ATTR_CQM, cqm); + nlmsg_free(cqm); + if (send_and_recv_msgs(drv, msg, NULL, NULL) == 0) return 0; msg = NULL; nla_put_failure: - nlmsg_free(cqm); nlmsg_free(msg); return -1; } diff --git a/wpa_supplicant/dbus/dbus_new_handlers.c b/wpa_supplicant/dbus/dbus_new_handlers.c index 3a5bcab..4cab426 100644 --- a/wpa_supplicant/dbus/dbus_new_handlers.c +++ b/wpa_supplicant/dbus/dbus_new_handlers.c @@ -614,6 +614,7 @@ DBusMessage * wpas_dbus_handler_create_interface(DBusMessage *message, out: os_free(driver); os_free(ifname); + os_free(confname); os_free(bridge_ifname); return reply;