diff options
author | David Bremner <david@tethera.net> | 2021-03-06 09:49:31 -0400 |
---|---|---|
committer | David Bremner <david@tethera.net> | 2021-03-13 08:49:49 -0400 |
commit | 12301392d492c07000abdcee84faa989d357331f (patch) | |
tree | 1dedb4f91709ee21cb270c6c10caad7ba07b0c1c | |
parent | eef21c284742fa5ae14d7d352acc3a4dc98821ce (diff) |
lib/open: use local talloc context in n_d_create_with_config
This better matches the memory allocation semantics in
notmuch_database_open_with_config.
-rw-r--r-- | lib/open.cc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/open.cc b/lib/open.cc index 6b717c1c..4c08e9db 100644 --- a/lib/open.cc +++ b/lib/open.cc @@ -425,6 +425,7 @@ notmuch_database_create_with_config (const char *database_path, GKeyFile *key_file = NULL; struct stat st; int err; + void *local = talloc_new (NULL); if ((status = _choose_database_path (config_path, profile, &key_file, &database_path, &message))) goto DONE; @@ -445,7 +446,7 @@ notmuch_database_create_with_config (const char *database_path, goto DONE; } - notmuch_path = talloc_asprintf (NULL, "%s/%s", database_path, ".notmuch"); + notmuch_path = talloc_asprintf (local, "%s/%s", database_path, ".notmuch"); err = mkdir (notmuch_path, 0755); if (err) { @@ -481,8 +482,7 @@ notmuch_database_create_with_config (const char *database_path, } DONE: - if (notmuch_path) - talloc_free (notmuch_path); + talloc_free (local); if (message) { if (status_string) |