From 7f9c996bd4f5f7eb24636c6bef42e73962430810 Mon Sep 17 00:00:00 2001 From: Peter Wang Date: Fri, 6 Apr 2012 11:48:02 +1000 Subject: [PATCH] [PATCH v3 1/5] config: Fix free in 'config get' implementation. --- fb/5b9e6c7be50530a73d8d941070de3ef6247260 | 85 +++++++++++++++++++++++ 1 file changed, 85 insertions(+) create mode 100644 fb/5b9e6c7be50530a73d8d941070de3ef6247260 diff --git a/fb/5b9e6c7be50530a73d8d941070de3ef6247260 b/fb/5b9e6c7be50530a73d8d941070de3ef6247260 new file mode 100644 index 000000000..bc36c7f8c --- /dev/null +++ b/fb/5b9e6c7be50530a73d8d941070de3ef6247260 @@ -0,0 +1,85 @@ +Return-Path: +X-Original-To: notmuch@notmuchmail.org +Delivered-To: notmuch@notmuchmail.org +Received: from localhost (localhost [127.0.0.1]) + by olra.theworths.org (Postfix) with ESMTP id 1389E431FC3 + for ; Thu, 5 Apr 2012 18:48:45 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: -0.799 +X-Spam-Level: +X-Spam-Status: No, score=-0.799 tagged_above=-999 required=5 + tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, + FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled +Received: from olra.theworths.org ([127.0.0.1]) + by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id 0NxMaaOGcGSX for ; + Thu, 5 Apr 2012 18:48:44 -0700 (PDT) +Received: from mail-pz0-f45.google.com (mail-pz0-f45.google.com + [209.85.210.45]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id B43CC431FC9 + for ; Thu, 5 Apr 2012 18:48:42 -0700 (PDT) +Received: by dacx6 with SMTP id x6so2370746dac.18 + for ; Thu, 05 Apr 2012 18:48:42 -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:x-mailer:in-reply-to:references; + bh=mkSjrE63V0UO6LxveJEQlNNV/Rp+LMoxf9IM3FkxXPs=; + b=S1qiyNSM4wl7HzYsEu7cqTEcbBW8SD9NNdQ/p2oQP5QDPdc/MMkXnBR5YKJ3SNlbda + BUcuPa5kdzAG8Qzo80r/7UjYvi5nQFtLBN89YtLhu3c4ZwISg6rSQ5mYa+PJGqdTd5A7 + utnSE1gwSrbZ2UfQGZSJsMk6AEQ/l3ClvFF3Kz/SU2B0auVm+Ky0ZDYFyfRN5qBCwMO6 + zp1fWkTTmb1+72JLvtwBAbnnDYcf9z3CYXzhx3SEOfhk7NH+Jc4bMUG/ZCrgj0FTGN4v + 6QdgWkZcwrF0DNV59qK6a+8gB8xFsSh4RdlfDVncmwthpdhCrVgmQmRKulxsOKR6wbhL + s5nA== +Received: by 10.68.193.161 with SMTP id hp1mr11191271pbc.106.1333676921940; + Thu, 05 Apr 2012 18:48:41 -0700 (PDT) +Received: from localhost (215.42.233.220.static.exetel.com.au. + [220.233.42.215]) + by mx.google.com with ESMTPS id h10sm4776832pbh.69.2012.04.05.18.48.39 + (version=TLSv1/SSLv3 cipher=OTHER); + Thu, 05 Apr 2012 18:48:40 -0700 (PDT) +From: Peter Wang +To: notmuch@notmuchmail.org +Subject: [PATCH v3 1/5] config: Fix free in 'config get' implementation. +Date: Fri, 6 Apr 2012 11:48:02 +1000 +Message-Id: <1333676886-9835-2-git-send-email-novalazy@gmail.com> +X-Mailer: git-send-email 1.7.4.4 +In-Reply-To: <1333676886-9835-1-git-send-email-novalazy@gmail.com> +References: <1332282698-7951-1-git-send-email-novalazy@gmail.com> + <1333676886-9835-1-git-send-email-novalazy@gmail.com> +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.13 +Precedence: list +List-Id: "Use and development of the notmuch mail system." + +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Fri, 06 Apr 2012 01:48:45 -0000 + +The array returned by g_key_file_get_string_list() should be freed with +g_strfreev(), not free(). +--- + notmuch-config.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/notmuch-config.c b/notmuch-config.c +index e9b2750..85fc774 100644 +--- a/notmuch-config.c ++++ b/notmuch-config.c +@@ -751,7 +751,7 @@ notmuch_config_command_get (void *ctx, char *item) + for (i = 0; i < length; i++) + printf ("%s\n", value[i]); + +- free (value); ++ g_strfreev (value); + } + + notmuch_config_close (config); +-- +1.7.4.4 + -- 2.26.2