mirror of
https://github.com/BlackLight/Snort_AIPreproc.git
synced 2024-11-27 22:25:12 +01:00
Fixed a leak in postgresql.c
This commit is contained in:
parent
b2ac185671
commit
b40dca6b14
1 changed files with 8 additions and 0 deletions
|
@ -116,8 +116,16 @@ postgresql_fetch_row ( PSQL_result *res )
|
||||||
void
|
void
|
||||||
postgresql_free_result ( PSQL_result *res )
|
postgresql_free_result ( PSQL_result *res )
|
||||||
{
|
{
|
||||||
|
int i, j, ntuples;
|
||||||
|
|
||||||
if ( res )
|
if ( res )
|
||||||
{
|
{
|
||||||
|
ntuples = PQntuples ( res->res );
|
||||||
|
|
||||||
|
for ( i=0; i < ntuples; i++ )
|
||||||
|
free ( res->rows[i] );
|
||||||
|
free ( res->rows );
|
||||||
|
|
||||||
PQclear ( res->res );
|
PQclear ( res->res );
|
||||||
free ( res );
|
free ( res );
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue