From patchwork Sat Sep 20 20:51:00 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eduardo Abinader X-Patchwork-Id: 391554 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]) by ozlabs.org (Postfix) with ESMTP id 5765C14012A for ; Sun, 21 Sep 2014 06:49:19 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id E100B9D410; Sat, 20 Sep 2014 16:49:12 -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 wHnF66ohv+g0; Sat, 20 Sep 2014 16:49:12 -0400 (EDT) Received: from maxx.shmoo.com (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id 2A6E617C13B; Sat, 20 Sep 2014 16:48:47 -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 4DD7917C026 for ; Sat, 20 Sep 2014 16:48:45 -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 ZYGCNQkOVWBh for ; Sat, 20 Sep 2014 16:48:38 -0400 (EDT) Received: from mail-qg0-f54.google.com (mail-qg0-f54.google.com [209.85.192.54]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (not verified)) by maxx.maxx.shmoo.com (Postfix) with ESMTPS id 467DE17C065 for ; Sat, 20 Sep 2014 16:48:38 -0400 (EDT) Received: by mail-qg0-f54.google.com with SMTP id a108so1329947qge.41 for ; Sat, 20 Sep 2014 13:48:38 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=mo50nm/FzDbpGUSKNmarzUIok7NEnwxQzqVxfS+QyZc=; b=Qc2+qDKoxc4ETpT7fk+O1txUBpFvy4OUhiX5FvkDIosDBCdMX9JbHeMZu37BCKCUGw 92S7HZoLSE2ogXTTyiIJyyBTqR5NsyGSI/8zpCKmy38NkYzw4mE3dOirsbMMBWEGiyb0 SSV4vbpd9W5/EOaOmN9fNMAweC+PKykGA9E4nksOoBXtc1bnDs4hiEj9OMx84jTQwAwT ERUTUAw/sDE500e1lZBYLsY+4ckpAnYSyOOw3tf5mL/t4DlHDIp1xpJDsyb9MQLttjZt 6gnmfwk4Tg9VV0hwWQWhdnjg3SLYITuIDCq8qbJc9brVIZjwj0Jx/Ce6/RiyuQxcYxrG UyFw== X-Gm-Message-State: ALoCoQn/PUBsv8zT8nKwqiH+7mHM8euoPE6pP2cku3saqawlFvZ5prtJvQXsIq912xvE+tFLWHjh X-Received: by 10.224.112.65 with SMTP id v1mr10976595qap.80.1411246117930; Sat, 20 Sep 2014 13:48:37 -0700 (PDT) Received: from localhost.localdomain ([177.143.179.64]) by mx.google.com with ESMTPSA id y9sm3805539qaf.15.2014.09.20.13.48.36 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 20 Sep 2014 13:48:37 -0700 (PDT) From: Eduardo Abinader To: hostap@lists.shmoo.com Subject: [PATCH 1/2] P2P: Flush services based on global p2p init and not p2p ifaces Date: Sat, 20 Sep 2014 16:51:00 -0400 Message-Id: <1411246261-10328-2-git-send-email-eduardo.abinader@openbossa.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1411246261-10328-1-git-send-email-eduardo.abinader@openbossa.org> References: <1411246261-10328-1-git-send-email-eduardo.abinader@openbossa.org> X-BeenThere: hostap@lists.shmoo.com X-Mailman-Version: 2.1.11 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 As P2P service are not necessarily attached to a iface, when added, proceed with same approach on p2p global deinit. Such approach solves memory leaks ocurring upon wpa_supplicant termination, when p2p services were registered previously. Signed-off-by: Eduardo Abinader --- wpa_supplicant/p2p_supplicant.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wpa_supplicant/p2p_supplicant.c b/wpa_supplicant/p2p_supplicant.c index e1a384b..c64665d 100644 --- a/wpa_supplicant/p2p_supplicant.c +++ b/wpa_supplicant/p2p_supplicant.c @@ -4077,8 +4077,8 @@ static void wpas_p2p_deinit_global(struct wpa_global *global) struct wpa_supplicant *wpa_s, *tmp; wpa_s = global->ifaces; - if (wpa_s) - wpas_p2p_service_flush(wpa_s); + + wpas_p2p_service_flush(global->p2p_init_wpa_s); if (global->p2p == NULL) return;