]> git.ipfire.org Git - thirdparty/ulogd2.git/commitdiff
db plugins: free memory at exit.
authorEric Leblond <eric@inl.fr>
Tue, 10 Mar 2009 06:37:38 +0000 (07:37 +0100)
committerEric Leblond <eric@inl.fr>
Tue, 10 Mar 2009 06:37:38 +0000 (07:37 +0100)
This patches frees an allocated buffer when ulogd is quitting.

util/db.c

index 7ab609de151b3f673823e1e3840bb2442a72726d..fee91b2df92bf6067ec061509d1d7cdf9c00d0de 100644 (file)
--- a/util/db.c
+++ b/util/db.c
@@ -193,6 +193,13 @@ int ulogd_db_stop(struct ulogd_pluginstance *upi)
                free(upi->input.keys);
                upi->input.keys = NULL;
        }
+
+       /* try to free the buffer for insert statement */
+       if (di->stmt) {
+               free(di->stmt);
+               di->stmt = NULL;
+       }
+
        return 0;
 }