mirror of
https://git.notmuchmail.org/git/notmuch
synced 2025-01-09 10:11:42 +01:00
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.
This commit is contained in:
parent
eef21c2847
commit
12301392d4
1 changed files with 3 additions and 3 deletions
|
@ -425,6 +425,7 @@ notmuch_database_create_with_config (const char *database_path,
|
||||||
GKeyFile *key_file = NULL;
|
GKeyFile *key_file = NULL;
|
||||||
struct stat st;
|
struct stat st;
|
||||||
int err;
|
int err;
|
||||||
|
void *local = talloc_new (NULL);
|
||||||
|
|
||||||
if ((status = _choose_database_path (config_path, profile, &key_file, &database_path, &message)))
|
if ((status = _choose_database_path (config_path, profile, &key_file, &database_path, &message)))
|
||||||
goto DONE;
|
goto DONE;
|
||||||
|
@ -445,7 +446,7 @@ notmuch_database_create_with_config (const char *database_path,
|
||||||
goto DONE;
|
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);
|
err = mkdir (notmuch_path, 0755);
|
||||||
if (err) {
|
if (err) {
|
||||||
|
@ -481,8 +482,7 @@ notmuch_database_create_with_config (const char *database_path,
|
||||||
}
|
}
|
||||||
|
|
||||||
DONE:
|
DONE:
|
||||||
if (notmuch_path)
|
talloc_free (local);
|
||||||
talloc_free (notmuch_path);
|
|
||||||
|
|
||||||
if (message) {
|
if (message) {
|
||||||
if (status_string)
|
if (status_string)
|
||||||
|
|
Loading…
Reference in a new issue