From patchwork Thu May 29 21:42:07 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eduardo Abinader X-Patchwork-Id: 353859 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 ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 10F671400DC for ; Fri, 30 May 2014 07:42:07 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id 8ECAF9D24A; Thu, 29 May 2014 17:42:04 -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 eUDlccsuCtdH; Thu, 29 May 2014 17:42:04 -0400 (EDT) Received: from maxx.shmoo.com (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id 6A3509D24C; Thu, 29 May 2014 17:41:58 -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 D00619D24C for ; Thu, 29 May 2014 17:41:56 -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 X3Dfcb6PX2N9 for ; Thu, 29 May 2014 17:41:49 -0400 (EDT) Received: from mail-yk0-f181.google.com (mail-yk0-f181.google.com [209.85.160.181]) (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 CF0F49D24A for ; Thu, 29 May 2014 17:41:49 -0400 (EDT) Received: by mail-yk0-f181.google.com with SMTP id 131so812328ykp.26 for ; Thu, 29 May 2014 14:41:48 -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; bh=SnpQG3T7wcvaCbJzxTq0cWzIQg5KnHJ5rYeGMvxx0tg=; b=SEQoEnu1X8SA6Hmj7GcxOAabpUqvRhiL0plVnIDWEGcyL993XR7/uq8FoAlQy16vcd O5UURuwUFRYj6ihnk+2V35Bw1MFvUYH8ih/3hC2BHsXP+DFACS2YL8U4HPtA3URziNn9 PI1RgwSJwoyWnzVQJ0WnOIycpvT/WBFAQOxq6mvW9+fEK8pGzQAEz+dnSFSXrETrouEZ JL2xV98gWwUASUPJ7QUhQ9KXZo1Gqd7ic9+Bl21eLtH082e35tes2LRJceqwNmaWh3Cw BsOnGxLyXhNry7uHhLSteSpGh7uyIbLbUdPaGeRGIhCcv+5yFXsxOJi4eYWiRsbG+KOQ 8udw== X-Gm-Message-State: ALoCoQmYamhK+sOiHLje20B1kkS/26vIBri55I8WC6H/HCOsR9cXOED5K9MtdORNatPHqtF51BKJ X-Received: by 10.236.2.165 with SMTP id 25mr14229101yhf.136.1401399708137; Thu, 29 May 2014 14:41:48 -0700 (PDT) Received: from aragorn.indt.org (mail.indt.org. [189.2.128.130]) by mx.google.com with ESMTPSA id f2sm2840485yhc.41.2014.05.29.14.41.46 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 29 May 2014 14:41:47 -0700 (PDT) From: Eduardo Abinader To: hostap@lists.shmoo.com Subject: [PATCH 1/1] hostapd_cli: fix seg fault for interface command Date: Thu, 29 May 2014 17:42:07 -0400 Message-Id: <1401399727-6558-1-git-send-email-eduardo.abinader@openbossa.org> X-Mailer: git-send-email 1.9.1 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 ctrl_ifname was not being freed and allocated by proper functions: os_free and os_strdup. Signed-off-by: Eduardo Abinader --- hostapd/hostapd_cli.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hostapd/hostapd_cli.c b/hostapd/hostapd_cli.c index c488b4f..1c4a84c 100644 --- a/hostapd/hostapd_cli.c +++ b/hostapd/hostapd_cli.c @@ -842,8 +842,8 @@ static int hostapd_cli_cmd_interface(struct wpa_ctrl *ctrl, int argc, } hostapd_cli_close_connection(); - free(ctrl_ifname); - ctrl_ifname = strdup(argv[0]); + os_free(ctrl_ifname); + ctrl_ifname = os_strdup(argv[0]); if (hostapd_cli_open_connection(ctrl_ifname)) { printf("Connected to interface '%s.\n", ctrl_ifname);