From patchwork Sun Feb 16 22:20:09 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lev Stipakov X-Patchwork-Id: 998 Return-Path: Delivered-To: patchwork@openvpn.net Delivered-To: patchwork@openvpn.net Received: from director7.mail.ord1d.rsapps.net ([172.30.191.6]) by backend30.mail.ord1d.rsapps.net with LMTP id 2MGJCRNbSl4LYAAAIUCqbw for ; Mon, 17 Feb 2020 04:21:23 -0500 Received: from proxy6.mail.ord1d.rsapps.net ([172.30.191.6]) by director7.mail.ord1d.rsapps.net with LMTP id EItgCRNbSl7ITQAAovjBpQ ; Mon, 17 Feb 2020 04:21:23 -0500 Received: from smtp37.gate.ord1d ([172.30.191.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by proxy6.mail.ord1d.rsapps.net with LMTP id QK7HCBNbSl6jAgAAQyIf0w ; Mon, 17 Feb 2020 04:21:23 -0500 X-Spam-Threshold: 95 X-Spam-Score: 0 X-Spam-Flag: NO X-Virus-Scanned: OK X-Orig-To: openvpnslackdevel@openvpn.net X-Originating-Ip: [216.105.38.7] Authentication-Results: smtp37.gate.ord1d.rsapps.net; iprev=pass policy.iprev="216.105.38.7"; spf=pass smtp.mailfrom="openvpn-devel-bounces@lists.sourceforge.net" smtp.helo="lists.sourceforge.net"; dkim=fail (signature verification failed) header.d=sourceforge.net; dkim=fail (signature verification failed) header.d=sf.net; dkim=fail (signature verification failed) header.d=gmail.com; dmarc=fail (p=none; dis=none) header.from=gmail.com X-Suspicious-Flag: YES X-Classification-ID: dc7449bc-5166-11ea-9b56-525400a11cf3-1-1 Received: from [216.105.38.7] ([216.105.38.7:57892] helo=lists.sourceforge.net) by smtp37.gate.ord1d.rsapps.net (envelope-from ) (ecelerity 4.2.38.62370 r(:)) with ESMTPS (cipher=DHE-RSA-AES256-GCM-SHA384) id 94/5D-20484-11B5A4E5; Mon, 17 Feb 2020 04:21:22 -0500 Received: from [127.0.0.1] (helo=sfs-ml-1.v29.lw.sourceforge.com) by sfs-ml-1.v29.lw.sourceforge.com with esmtp (Exim 4.90_1) (envelope-from ) id 1j3cZs-0004jh-MS; Mon, 17 Feb 2020 09:20:32 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-1.v29.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) (envelope-from ) id 1j3cZr-0004jS-0P for openvpn-devel@lists.sourceforge.net; Mon, 17 Feb 2020 09:20:31 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: MIME-Version:Content-Type:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=ur7BMjd1J5sZxAOeZsjJZ7x1UXKrHusY5ihCeqUzTxU=; b=FDnjFBpkMwV7EpSP28nWxjkhXV u1/4GBX5tOtSfc4EAYWSYW3hxkjHF6nCE64O7hUt7R0CM5Vq7AT4VRERriHrVkcfQ78YKqsCocrSi WWmjKl5phrkCSfZI5ZE6kFXjqv4v5Vw8Ab1SGmgOa+P4Vo+rK652N8eI+vYSHwvcabis=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:MIME-Version: Content-Type:Content-Transfer-Encoding:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=ur7BMjd1J5sZxAOeZsjJZ7x1UXKrHusY5ihCeqUzTxU=; b=Jz8DGxjMJYEC4PFHV4jJTkwtS0 zJJzejh64e7NXrRqOzKjae6D0PoeXCo0y8AHo4QU9nuixJlM/df3Hb8bva/YwTUrlypfyLaGLOBG1 R3DuxSP71xWHwaEfaWFZCie3ekv0NZefL97gws0IVZLpwEvHGrwcA7iOKpTjku2GPRhw=; Received: from mail-wr1-f66.google.com ([209.85.221.66]) by sfi-mx-3.v28.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.92.2) id 1j3cZp-006GfI-UQ for openvpn-devel@lists.sourceforge.net; Mon, 17 Feb 2020 09:20:30 +0000 Received: by mail-wr1-f66.google.com with SMTP id n10so16768938wrm.1 for ; Mon, 17 Feb 2020 01:20:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=ur7BMjd1J5sZxAOeZsjJZ7x1UXKrHusY5ihCeqUzTxU=; b=kP8EctWdvlQphN7oKojKIPaNb4lTeX8Wg0VdF3XaZToZNPoWQ44gEYtSvFrnqSmLej iUdkT/YDJHAH69FDV9TtW2hV8AIxZty/wNrQqfYlHytESHro0PYHb0Z0gT93bCS9TFmw lylAs3s6uA8O2wM/aoO9EerMsypv3xdb5egjVHCFis8wYgglM1glrpMleVI7vBTlz+8E J/T5ydVEZvm2QaesTVN/sBYoNzODB+Y2RChc+bggXnuY1H0kXIdRSpANqIYmeGOxRbBp ApGb7Db5WJ3yVjFEisUDgR9fTzczyvF6tDBd/WJm7EM0D0jkHESTvejjuBe6O/sLeFVw fOIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=ur7BMjd1J5sZxAOeZsjJZ7x1UXKrHusY5ihCeqUzTxU=; b=OeW+g7+zoe0M+uVYIIAfqep91K65dacSuAtAySm5SeBJgWfW3qfJ3PEkXF8QPUiEgN yMzhMyT0CGM00X7ueaPK0O95ovqsHyARwS/Pc2UsSFA6yIshrkEgc1TZiGxqhhe09jRN ahxFp/eBPIYH/6ifrVNGdEyimk1h49nYuWucpbK2WF0ZLBmVC1O/pvtXPPmFc8lsbPz7 NRU7v/T9vTXgrHJqP5oq6brBG/UgF5Rfv4V4Ps1cIdD1/tyIHejA3JatvKSWt5/6u7aq ZtnC5JPT86QjI/yJxCrhBdysH8GHpkWLwTKmbFQsq48Jl1ONmiesMwClglr+FdoNlaks HwVQ== X-Gm-Message-State: APjAAAW5jpg29v1oAnRblM0GMH2OZCPeWDSeRKD4w8PNMlHR7FfSk0/f 5QuqaGHiGp6uQqeAjW314tfT1kKcXtc= X-Google-Smtp-Source: APXvYqwb8POFkYSjYXas8dmMrf+HbZk9K6ncJrahGRF8SPf2ZomDp1YBwI1KXyIF1JfiloER5JFuaA== X-Received: by 2002:adf:f052:: with SMTP id t18mr20153074wro.192.1581931222904; Mon, 17 Feb 2020 01:20:22 -0800 (PST) Received: from LAPTOP-4L3N7KFS.panoulu.local ([2a00:1d50:3:0:a11e:653e:991c:4e5f]) by smtp.gmail.com with ESMTPSA id y6sm76774wrl.17.2020.02.17.01.20.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Feb 2020 01:20:22 -0800 (PST) From: Lev Stipakov To: openvpn-devel@lists.sourceforge.net Date: Mon, 17 Feb 2020 11:20:09 +0200 Message-Id: <20200217092009.238-1-lstipakov@gmail.com> X-Mailer: git-send-email 2.17.1 X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (lstipakov[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.221.66 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.221.66 listed in wl.mailspike.net] X-Headers-End: 1j3cZp-006GfI-UQ Subject: [Openvpn-devel] [PATCH] ssl.c: remove unneeded local variable X-BeenThere: openvpn-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Lev Stipakov MIME-Version: 1.0 Errors-To: openvpn-devel-bounces@lists.sourceforge.net X-getmail-retrieved-from-mailbox: Inbox From: Lev Stipakov Remove unneeded _orig variable, which stores pointer to tokenized string. Unlike strsep(), strtok() doesn't modify pointer itself, only string, so it is safe to call free() on that pointer. Signed-off-by: Lev Stipakov --- src/openvpn/ssl.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/openvpn/ssl.c b/src/openvpn/ssl.c index e708fc93..b92aada3 100644 --- a/src/openvpn/ssl.c +++ b/src/openvpn/ssl.c @@ -1918,7 +1918,6 @@ bool tls_item_in_cipher_list(const char *item, const char *list) { char *tmp_ciphers = string_alloc(list, NULL); - char *tmp_ciphers_orig = tmp_ciphers; const char *token = strtok(tmp_ciphers, ":"); while (token) @@ -1929,7 +1928,7 @@ tls_item_in_cipher_list(const char *item, const char *list) } token = strtok(NULL, ":"); } - free(tmp_ciphers_orig); + free(tmp_ciphers); return token != NULL; }