Skip to Content.
Sympa Menu

freetds - [freetds] dbstring_free memory leak

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Edward Quackenbush <EdwardQuackenbush AT symantec.com>
  • To: freetds AT lists.ibiblio.org
  • Subject: [freetds] dbstring_free memory leak
  • Date: Thu, 29 Jan 2004 16:28:21 -0500

I encountered a memory leak when repeatedly opening and closing a
conection using the DB-lib interface. It appears that the dbstring_free
function in dblib.c does not free the string. The following patch should
correct this issue.
eq

--- ../freetds-0.62.1/src/dblib/dblib.c Fri Dec 26 18:11:08 2003
+++ ../freetds-0.62.1-werking/src/dblib/dblib.c Thu Jan 29 20:18:18 2004
@@ -737,9 +737,6 @@
if ((*dbstrp)->strnext != NULL) {
dbstring_free(&((*dbstrp)->strnext));
}
+ if ((*dbstrp)->strtext != NULL) {
+ free((*dbstrp)->strtext);
+ }
free(*dbstrp);
*dbstrp = NULL;
}




Archive powered by MHonArc 2.6.24.

Top of Page