mirror of
https://git.notmuchmail.org/git/notmuch
synced 2024-12-23 01:44:52 +01:00
notmuch-config: Fix memleaks.
While talloc is great we need to free the g_error by hand. Tested-by: Stefan Schmidt <stefan@datenfreihafen.org> Signed-off-by: Holger Freyther <zecke@selfish.org>
This commit is contained in:
parent
b5d7632000
commit
6c7ec294bb
1 changed files with 3 additions and 0 deletions
|
@ -207,9 +207,11 @@ notmuch_config_open (void *ctx,
|
||||||
fprintf (stderr, "Error reading configuration file %s: %s\n",
|
fprintf (stderr, "Error reading configuration file %s: %s\n",
|
||||||
config->filename, error->message);
|
config->filename, error->message);
|
||||||
talloc_free (config);
|
talloc_free (config);
|
||||||
|
g_error_free (error);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
g_error_free (error);
|
||||||
is_new = 1;
|
is_new = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -308,6 +310,7 @@ notmuch_config_save (notmuch_config_t *config)
|
||||||
if (! g_file_set_contents (config->filename, data, length, &error)) {
|
if (! g_file_set_contents (config->filename, data, length, &error)) {
|
||||||
fprintf (stderr, "Error saving configuration to %s: %s\n",
|
fprintf (stderr, "Error saving configuration to %s: %s\n",
|
||||||
config->filename, error->message);
|
config->filename, error->message);
|
||||||
|
g_error_free (error);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue