aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDavid Bremner <david@tethera.net>2023-12-03 14:56:44 -0400
committerDavid Bremner <david@tethera.net>2023-12-06 07:33:05 -0400
commitb97cd90040a8353e6f94c317af2020f3d6e67a2e (patch)
treee5e3e1d33ea5cf5ff458ba328e85cbe198068df0 /lib
parent5a582e8ed9b9bfd88e63149fb671510bc2b2e9f8 (diff)
lib: clear error message on success in _choose_database_path
Previously we both found a database and returned a message saying that the database could not be found (along with a success code). This change should prevent spurious error output.
Diffstat (limited to 'lib')
-rw-r--r--lib/open.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/open.cc b/lib/open.cc
index 005872dc..463e38bf 100644
--- a/lib/open.cc
+++ b/lib/open.cc
@@ -249,6 +249,11 @@ _choose_database_path (notmuch_database_t *notmuch,
return NOTMUCH_STATUS_NO_DATABASE;
}
+ if (*message) {
+ free (*message);
+ *message = NULL;
+ }
+
return NOTMUCH_STATUS_SUCCESS;
}