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

noreply at ...12... noreply at ...12...
Sat May 11 20:04:02 EDT 2002


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

Category: None
Group: None
Status: Open
Resolution: None
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




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

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