summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichal Domonkos <mdomonko@redhat.com>2021-06-09 21:31:40 +0200
committerPanu Matilainen <pmatilai@redhat.com>2021-08-20 11:44:09 +0300
commita141a7ef4d315c2e453a58dc45a78dd05bf4ed86 (patch)
treec644618baff7962410a90b8df46855ad1433b99c
parentcc515e87f5345be9237a61dbeaef621ec746a392 (diff)
downloadrpm-a141a7ef4d315c2e453a58dc45a78dd05bf4ed86.tar.gz
Fix memory leak in sqlexec()
Callers are supposed to free the error strings themselves: https://www.sqlite.org/capi3ref.html#sqlite3_exec Found by Coverity. (cherry picked from commit d8dc4fd37b1d90cd97de7fcf484d449ec132c9b3)
-rw-r--r--lib/backend/sqlite.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/backend/sqlite.c b/lib/backend/sqlite.c
index 7c2de45aa..dbefeb163 100644
--- a/lib/backend/sqlite.c
+++ b/lib/backend/sqlite.c
@@ -233,6 +233,7 @@ static int sqlexec(sqlite3 *sdb, const char *fmt, ...)
rpmlog(RPMLOG_DEBUG, "%s: %d\n", cmd, rc);
sqlite3_free(cmd);
+ sqlite3_free(err);
return rc ? RPMRC_FAIL : RPMRC_OK;
}