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.
This commit is contained in:
Michal Domonkos 2021-06-09 21:31:40 +02:00 committed by Florian Festi
parent b79bc6872d
commit d8dc4fd37b
1 changed files with 1 additions and 0 deletions

View File

@ -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;
}