From: Lev Stipakov Date: Mon, 17 Feb 2020 11:20:09 +0200 Message-Id: <20200217092009.238-1-lstipakov@...277...> Subject: [Openvpn-devel] [PATCH] ssl.c: remove unneeded local variable List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit To: openvpn-devel@lists.sourceforge.net Cc: Lev Stipakov 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; } -- 2.17.1