From patchwork Sun Nov 2 12:03:37 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Akihiro TSUKADA X-Patchwork-Id: 5211681 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 882EA9F349 for ; Sun, 2 Nov 2014 12:03:55 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B4935201C8 for ; Sun, 2 Nov 2014 12:03:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E41F4201C0 for ; Sun, 2 Nov 2014 12:03:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751897AbaKBMDw (ORCPT ); Sun, 2 Nov 2014 07:03:52 -0500 Received: from mail-pd0-f177.google.com ([209.85.192.177]:35677 "EHLO mail-pd0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751103AbaKBMDv (ORCPT ); Sun, 2 Nov 2014 07:03:51 -0500 Received: by mail-pd0-f177.google.com with SMTP id v10so9886538pde.36 for ; Sun, 02 Nov 2014 04:03:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=sDOAGy0G2AVsofKZnHFl+/CqFEIRN3Ps/+Og3ABGugU=; b=lCgVJUZ0SjomUMEKNo0rIAZHqHzJFHid1k1JjKuMnIXZqY50m0CNcRVqYNjffnJiHv XmDc3b+qosMANrDsLzj+AClrmH7MBzDafiGQDMUok8820+LiRKJ6G4swUCt0jOFjFPgZ V9CwOlUEck8e21Z1ZiOLDXOAWTSvhZgom0mjM6c91EnKMxh5MlmyjjN54Kmcy2TmoS3E L2A8WzatO7ljkjCOFFXf45fp8RIYxF10RzdZd9Wst41Rx5R2dOg7ZILqkebvY0nKJBzm J22aqjhGbeoIuxqPPDh662ERrQ4KyxoAxQYwR8G6lo4IAxxp01v+eZ831TqJOPftdYPS lK9A== X-Received: by 10.66.157.161 with SMTP id wn1mr36544330pab.40.1414929831183; Sun, 02 Nov 2014 04:03:51 -0800 (PST) Received: from seabird.localdomain.localdomain (softbank219203027033.bbtec.net. [219.203.27.33]) by mx.google.com with ESMTPSA id nu9sm14455381pbb.81.2014.11.02.04.03.48 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 02 Nov 2014 04:03:50 -0800 (PST) From: tskd08@gmail.com To: linux-media@vger.kernel.org Cc: m.chehab@samsung.com, Akihiro Tsukada Subject: [PATCH] v4l-utils/libdvbv5: fix memory leak in dvb_guess_user_country() Date: Sun, 2 Nov 2014 21:03:37 +0900 Message-Id: <1414929817-11834-1-git-send-email-tskd08@gmail.com> X-Mailer: git-send-email 2.1.3 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Akihiro Tsukada Signed-off-by: Akihiro Tsukada --- lib/libdvbv5/countries.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/libdvbv5/countries.c b/lib/libdvbv5/countries.c index 7acdcc7..9e68ea6 100644 --- a/lib/libdvbv5/countries.c +++ b/lib/libdvbv5/countries.c @@ -395,13 +395,13 @@ enum dvb_country_t dvb_guess_user_country(void) if (! buf || strlen(buf) < 2) continue; - buf = strdup(buf); - pbuf= buf; - if (! strncmp(buf, "POSIX", MIN(strlen(buf), 5)) || ! (strncmp(buf, "en", MIN(strlen(buf), 2)) && !isalpha(buf[2])) ) continue; + buf = strdup(buf); + pbuf= buf; + // assuming 'language_country.encoding@variant' // country after '_', if given