Skip to content

Commit 9943e5c

Browse files
committed
do not leak sql string
Signed-off-by: Dorin Hogea <[email protected]>
1 parent f32ac3c commit 9943e5c

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

db/sqlanalyze.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -773,6 +773,7 @@ static int analyze_table_int(table_descriptor_t *td, struct thr_handle *thr_self
773773
sqlite3_free(sql); sql = NULL;
774774
goto error;
775775
}
776+
sqlite3_free(sql); sql = NULL;
776777
if (!get_dbtable_by_name("sqlite_stat4")) continue;
777778
sql = sqlite3_mprintf("INSERT INTO sqlite_stat4(tbl, idx, neq, nlt, ndlt, sample) "
778779
"SELECT tbl, '%q', neq, nlt, ndlt, sample FROM sqlite_stat4 "
@@ -784,6 +785,7 @@ static int analyze_table_int(table_descriptor_t *td, struct thr_handle *thr_self
784785
sqlite3_free(sql); sql = NULL;
785786
goto error;
786787
}
788+
sqlite3_free(sql); sql = NULL;
787789
}
788790

789791
if (rc)

0 commit comments

Comments
 (0)