From 40963c702e8e284b694195d6dd16d050eab182f4 Mon Sep 17 00:00:00 2001 From: Michael Vetter Date: Fri, 6 Mar 2026 14:49:26 +0100 Subject: [PATCH] fix: database return NULL if no history limits are found log_database_get_limits_info should return NULL when a contact has no history in the database. We hit a bug with `/msg adsf@asd` before. --- src/database.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/database.c b/src/database.c index c30d5271..efeb6d32 100644 --- a/src/database.c +++ b/src/database.c @@ -309,6 +309,9 @@ log_database_get_limits_info(const gchar* const contact_barejid, gboolean is_las msg->stanzaid = _db_strdup(archive_id); msg->timestamp = g_date_time_new_from_iso8601(date, NULL); + } else { + message_free(msg); + msg = NULL; } sqlite3_finalize(stmt);