Module: sip-router Branch: janakj/flatstore Commit: e6152f724cbff2a43c76d1f552aa5ee7d2ef03b0 URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=e6152f72...
Author: Jan Janak jan@iptel.org Committer: Jan Janak jan@iptel.org Date: Tue May 31 12:59:30 2005 +0000
- fixed memory leak in flat_reopen_connection, reported by Bayan William Towfiq william@telepacket.com
---
modules/db_flatstore/flat_con.c | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/modules/db_flatstore/flat_con.c b/modules/db_flatstore/flat_con.c index d691c22..e148429 100644 --- a/modules/db_flatstore/flat_con.c +++ b/modules/db_flatstore/flat_con.c @@ -163,10 +163,17 @@ int flat_reopen_connection(struct flat_con* con)
if (con->file) { fclose(con->file); + con->file = 0;
fn = get_name(con->id); + if (fn == 0) { + LOG(L_ERR, "flat_reopen_connection: get_name() failed\n"); + return -1; + }
con->file = fopen(fn, "a"); + pkg_free(fn); + if (!con->file) { LOG(L_ERR, "flat_reopen_connection: Invalid parameter value\n"); return -1;