[PATCH v4 1/6] config: Fix free in 'config get' implementation.
authorPeter Wang <novalazy@gmail.com>
Sat, 14 Apr 2012 01:41:01 +0000 (11:41 +1000)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:46:20 +0000 (09:46 -0800)
fb/34116e9fa1410436b2b46347ab8630185fbd24 [new file with mode: 0644]

diff --git a/fb/34116e9fa1410436b2b46347ab8630185fbd24 b/fb/34116e9fa1410436b2b46347ab8630185fbd24
new file mode 100644 (file)
index 0000000..8ac0553
--- /dev/null
@@ -0,0 +1,85 @@
+Return-Path: <novalazy@gmail.com>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id BA38E431FBD\r
+       for <notmuch@notmuchmail.org>; Fri, 13 Apr 2012 18:42:00 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.799\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.799 tagged_above=-999 required=5\r
+       tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,\r
+       FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id OxXs9kGvkL8I for <notmuch@notmuchmail.org>;\r
+       Fri, 13 Apr 2012 18:42:00 -0700 (PDT)\r
+Received: from mail-pz0-f45.google.com (mail-pz0-f45.google.com\r
+       [209.85.210.45]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
+       (No client certificate requested)\r
+       by olra.theworths.org (Postfix) with ESMTPS id 19589431FB6\r
+       for <notmuch@notmuchmail.org>; Fri, 13 Apr 2012 18:42:00 -0700 (PDT)\r
+Received: by mail-pz0-f45.google.com with SMTP id x6so4543752dac.18\r
+       for <notmuch@notmuchmail.org>; Fri, 13 Apr 2012 18:41:59 -0700 (PDT)\r
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;\r
+       h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references;\r
+       bh=mkSjrE63V0UO6LxveJEQlNNV/Rp+LMoxf9IM3FkxXPs=;\r
+       b=FzpfA47ugLXgjj2IPsPlkmMfM9hUkvrkRXTLQRW0ypEjfhR9BC6gQtgJNLs9HJdGi7\r
+       +/2OAbTrQwsM6Gn1bVtEtaF3oaBhHiW0hQNHTwS9YL4sIcC6LrlTlKrGJ0di3en9VQOl\r
+       8TWFF6VBeMILAlnR7Qh9w6RBRMU5AhpyXvEvIwKonkqa8DAr25iaKmTylicQ0jVMcHfY\r
+       l9W7o6TWxsTGaq4X+SnAoR2aH/01qJq8TYrhEBdmiac/kATymxHKMaMrOj23yi1GRCtd\r
+       Y3jIMz8deaCJ+u19Nxu/0y9RNXbQc4CqywJ4cJvXHOZe3F4U2h9wqmjbOhQ3bxSYlTO9\r
+       M4oQ==\r
+Received: by 10.68.202.167 with SMTP id kj7mr9222501pbc.9.1334367719823;\r
+       Fri, 13 Apr 2012 18:41:59 -0700 (PDT)\r
+Received: from localhost (215.42.233.220.static.exetel.com.au.\r
+       [220.233.42.215])\r
+       by mx.google.com with ESMTPS id h10sm10245042pbh.69.2012.04.13.18.41.54\r
+       (version=TLSv1/SSLv3 cipher=OTHER);\r
+       Fri, 13 Apr 2012 18:41:58 -0700 (PDT)\r
+From: Peter Wang <novalazy@gmail.com>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH v4 1/6] config: Fix free in 'config get' implementation.\r
+Date: Sat, 14 Apr 2012 11:41:01 +1000\r
+Message-Id: <1334367666-10954-2-git-send-email-novalazy@gmail.com>\r
+X-Mailer: git-send-email 1.7.4.4\r
+In-Reply-To: <1334367666-10954-1-git-send-email-novalazy@gmail.com>\r
+References: <1332282698-7951-1-git-send-email-novalazy@gmail.com>\r
+       <1334367666-10954-1-git-send-email-novalazy@gmail.com>\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+       <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Sat, 14 Apr 2012 01:42:00 -0000\r
+\r
+The array returned by g_key_file_get_string_list() should be freed with\r
+g_strfreev(), not free().\r
+---\r
+ notmuch-config.c |    2 +-\r
+ 1 files changed, 1 insertions(+), 1 deletions(-)\r
+\r
+diff --git a/notmuch-config.c b/notmuch-config.c\r
+index e9b2750..85fc774 100644\r
+--- a/notmuch-config.c\r
++++ b/notmuch-config.c\r
+@@ -751,7 +751,7 @@ notmuch_config_command_get (void *ctx, char *item)\r
+       for (i = 0; i < length; i++)\r
+           printf ("%s\n", value[i]);\r
+ \r
+-      free (value);\r
++      g_strfreev (value);\r
+     }\r
+ \r
+     notmuch_config_close (config);\r
+-- \r
+1.7.4.4\r
+\r