Author: Andy Green Date: Sun Apr 19 21:13:59 2026 +0100 CID 503233: NULL_RETURNS diff --git a/src/common/c-sqlite3.c b/src/common/c-sqlite3.c index 03d573a..bf91b12 100644 --- a/src/common/c-sqlite3.c +++ b/src/common/c-sqlite3.c @@ -94,7 +94,6 @@ sai_event_db_ensure_open(struct lws_context *cx, lws_dll2_owner_t *sqlite3_cache sai_sqlite3_statement(*ppdb, "CREATE INDEX IF NOT EXISTS idx_art_task ON artifacts(task_uuid);", "create artifact index"); sc = malloc(sizeof(*sc)); - memset(sc, 0, sizeof(*sc)); if (!sc) { lwsl_err("%s: unable to alloc sc for %s\n", __func__, filepath); @@ -103,6 +102,8 @@ sai_event_db_ensure_open(struct lws_context *cx, lws_dll2_owner_t *sqlite3_cache return 6; } + memset(sc, 0, sizeof(*sc)); + lws_strncpy(sc->uuid, event_uuid, sizeof(sc->uuid)); sc->refcount = 1; sc->pdb = *ppdb;