From patchwork Tue Apr 28 14:07:28 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans Dedecker X-Patchwork-Id: 465564 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from arrakis.dune.hu (arrakis.dune.hu [78.24.191.176]) (using TLSv1.1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 88FC81400B7 for ; Wed, 29 Apr 2015 00:08:37 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="verification failed; unprotected key" header.d=gmail.com header.i=@gmail.com header.b=m7hBJWLz; dkim-adsp=none (unprotected policy); dkim-atps=neutral Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id 571ED28BC65; Tue, 28 Apr 2015 16:06:47 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on arrakis.dune.hu X-Spam-Level: X-Spam-Status: No, score=-1.5 required=5.0 tests=BAYES_00,FREEMAIL_FROM, T_DKIM_INVALID autolearn=unavailable version=3.3.2 Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id 4B15228BC5F for ; Tue, 28 Apr 2015 16:06:40 +0200 (CEST) X-policyd-weight: using cached result; rate: -8.5 Received: from mail-wi0-f172.google.com (mail-wi0-f172.google.com [209.85.212.172]) by arrakis.dune.hu (Postfix) with ESMTPS for ; Tue, 28 Apr 2015 16:06:40 +0200 (CEST) Received: by wiun10 with SMTP id n10so30587569wiu.1 for ; Tue, 28 Apr 2015 07:07:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=IQhu7HCwVugdakPy5HTIrHkT9poDLxS5mdU6URSyHXQ=; b=m7hBJWLzOzLWg8SKAgmBTCMsOcZsz6fhy1AZydIRZ/g06kY5VeA/gHrVw4wEFMSCFA Xh6HN6WRJ13xmeKQUlPgi0udoDpSXKcVVGIJ3yWFAtrWzyh5gUfCIcUNnFEJJQ6qmZkn kTsDJTdUn70d7fko7ZERbbv3HUeVfxbNHVsJhGmHYY19/F1XRMvN243pw+SAG2GbSW8o ONdcLHKGn6feY9QphcunEHEMZAfNzDiZ8KLX/9DNWCroGvW2GnfrOitRuLFby5SKJqjm OsycY1NuaUHZSvgk8bMXiXLRNwmpJZpGBvYafTOaJm52SYSdUHMQ9FEfhkLlIkLyuYX/ 6lIg== X-Received: by 10.180.90.72 with SMTP id bu8mr29869098wib.62.1430230063217; Tue, 28 Apr 2015 07:07:43 -0700 (PDT) Received: from cplx43.eu.thmulti.com ([141.11.62.7]) by mx.google.com with ESMTPSA id n3sm16722590wix.1.2015.04.28.07.07.42 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 28 Apr 2015 07:07:42 -0700 (PDT) From: Hans Dedecker To: openwrt-devel@lists.openwrt.org Date: Tue, 28 Apr 2015 16:07:28 +0200 Message-Id: <1430230048-13193-2-git-send-email-dedeckeh@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1430230048-13193-1-git-send-email-dedeckeh@gmail.com> References: <1430230048-13193-1-git-send-email-dedeckeh@gmail.com> Cc: Hans Dedecker , cyrus@openwrt.org Subject: [OpenWrt-Devel] [PATCH] ubus: Fix memleak in examples/client in case of failure X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: openwrt-devel-bounces@lists.openwrt.org Sender: "openwrt-devel" Signed-off-by: Hans Dedecker --- examples/client.c | 1 + 1 file changed, 1 insertion(+) diff --git a/examples/client.c b/examples/client.c index 952ab54..7ef5663 100644 --- a/examples/client.c +++ b/examples/client.c @@ -118,6 +118,7 @@ static void test_count(struct uloop_timeout *timeout) blobmsg_add_string(&b, "string", s); if (ubus_lookup_id(ctx, "test", &id)) { + free(s); fprintf(stderr, "Failed to look up test object\n"); return; }