[Snort-devel] [ snort-Bugs-553556 ] memory leak logging to postgresql DB

noreply at ...12... noreply at ...12...
Wed May 15 08:53:02 EDT 2002


Bugs item #553556, was opened at 2002-05-07 23:13
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=103357&aid=553556&group_id=3357

Category: None
Group: None
>Status: Closed
>Resolution: Accepted
Priority: 5
Submitted By: Nobody/Anonymous (nobody)
Assigned to: Nobody/Anonymous (nobody)
Summary: memory leak logging to postgresql DB

Initial Comment:
snort 1.8.6

You can keep a PGresult object around for as long as 
you need it; it does not go away when you issue a new 
query, nor even if you close the connection. To get 
rid of it, you must call PQclear. Failure to do this 
will result in memory leaks in the frontend 
application.

patch:

*** spo_database.c.orig Mon Apr  8 09:04:53 2002
--- spo_database.c      Tue May  7 20:07:53 2002
*************** int Insert(char * query, DatabaseData *
*** 1278,1284 ****
              {
                  ErrorMessage("database: 
postgresql_error: %s\n", PQerrorMessage(data-
>p_connection));
              }
!         }
      }
  #endif

--- 1278,1285 ----
              {
                  ErrorMessage("database: 
postgresql_error: %s\n", PQerrorMessage(data-
>p_connection));
              }
!         }
!         PQclear(data->p_result);
      }
  #endif

*************** int Select(char * query, DatabaseData *
*** 1406,1411 ****
--- 1407,1413 ----
                  ErrorMessage("database: 
postgresql_error: %s\n",PQerrorMessage(data-
>p_connection));
              }
          }
+         PQclear(data->p_result);
      }
  #endif




----------------------------------------------------------------------

>Comment By: Roman Danyliw (danyliw)
Date: 2002-05-13 17:33

Message:
Logged In: YES 
user_id=136911

Patch committed to CVS.

Roman

----------------------------------------------------------------------

You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=103357&aid=553556&group_id=3357




More information about the Snort-devel mailing list