1 Return-Path: <too@guru-group.fi>
\r
2 X-Original-To: notmuch@notmuchmail.org
\r
3 Delivered-To: notmuch@notmuchmail.org
\r
4 Received: from localhost (localhost [127.0.0.1])
\r
5 by olra.theworths.org (Postfix) with ESMTP id C9C9E431FAE
\r
6 for <notmuch@notmuchmail.org>; Thu, 7 Aug 2014 08:20:22 -0700 (PDT)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]
\r
13 Received: from olra.theworths.org ([127.0.0.1])
\r
14 by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)
\r
15 with ESMTP id 29k-NnquOo3X for <notmuch@notmuchmail.org>;
\r
16 Thu, 7 Aug 2014 08:20:18 -0700 (PDT)
\r
17 Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34])
\r
18 by olra.theworths.org (Postfix) with ESMTP id D8CE9431FC2
\r
19 for <notmuch@notmuchmail.org>; Thu, 7 Aug 2014 08:20:05 -0700 (PDT)
\r
20 Received: by guru.guru-group.fi (Postfix, from userid 501)
\r
21 id D52BE1000E0; Thu, 7 Aug 2014 18:19:52 +0300 (EEST)
\r
22 From: Tomi Ollila <tomi.ollila@iki.fi>
\r
23 To: notmuch@notmuchmail.org
\r
24 Subject: [PATCH] notmuch-config: talloc_strdup MAILDIR and NAME environment
\r
26 Date: Thu, 7 Aug 2014 18:19:50 +0300
\r
27 Message-Id: <1407424790-12538-1-git-send-email-tomi.ollila@iki.fi>
\r
28 X-Mailer: git-send-email 2.0.0
\r
29 Cc: tomi.ollila@iki.fi
\r
30 X-BeenThere: notmuch@notmuchmail.org
\r
31 X-Mailman-Version: 2.1.13
\r
33 List-Id: "Use and development of the notmuch mail system."
\r
34 <notmuch.notmuchmail.org>
\r
35 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
36 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
37 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
38 List-Post: <mailto:notmuch@notmuchmail.org>
\r
39 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
40 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
41 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
42 X-List-Received-Date: Thu, 07 Aug 2014 15:20:22 -0000
\r
44 When defined -- the pointer is soon given to talloc_free() which
\r
45 expects it to be allocated by talloc.
\r
47 notmuch-config.c | 8 ++++++--
\r
48 1 file changed, 6 insertions(+), 2 deletions(-)
\r
50 diff --git a/notmuch-config.c b/notmuch-config.c
\r
51 index 88831e2..db487db 100644
\r
52 --- a/notmuch-config.c
\r
53 +++ b/notmuch-config.c
\r
54 @@ -324,7 +324,9 @@ notmuch_config_open (void *ctx,
\r
56 if (notmuch_config_get_database_path (config) == NULL) {
\r
57 char *path = getenv ("MAILDIR");
\r
60 + path = talloc_strdup (config, path);
\r
62 path = talloc_asprintf (config, "%s/mail",
\r
64 notmuch_config_set_database_path (config, path);
\r
65 @@ -333,7 +335,9 @@ notmuch_config_open (void *ctx,
\r
67 if (notmuch_config_get_user_name (config) == NULL) {
\r
68 char *name = getenv ("NAME");
\r
71 + name = talloc_strdup (config, name);
\r
73 name = get_name_from_passwd_file (config);
\r
74 notmuch_config_set_user_name (config, name);
\r