]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Close sqlite handle when we fail to pre-poopulate the database. Closes #5392
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Thu, 1 Aug 2024 13:16:15 +0000 (07:16 -0600)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Thu, 1 Aug 2024 13:16:24 +0000 (07:16 -0600)
src/modules/rlm_sql/drivers/rlm_sql_sqlite/rlm_sql_sqlite.c

index 658470dc1cddc24166bf195f4eb0831eea3a48d7..1ef18a881555a28dd4b36733c47892293859c6ad 100644 (file)
@@ -771,7 +771,10 @@ static int mod_instantiate(module_inst_ctx_t const *mctx)
                        if (!p) continue;
 
                        ret = sql_loadfile(mctx->mi->conf, db, p);
-                       if (ret < 0) goto unlink;
+                       if (ret < 0) {
+                               (void) sqlite3_close(db);
+                               goto unlink;
+                       }
                }
 
                status = sqlite3_close(db);