From 205d90a11d0ba3410fa9aeac0e74ce3094e11e9b Mon Sep 17 00:00:00 2001 From: David Anderson Date: Sun, 9 Jan 2005 08:44:41 +0000 Subject: [PATCH] *** empty log message *** svn path=/trunk/boinc/; revision=5040 --- checkin_notes | 6 ++++++ db/db_base.C | 12 ++++-------- tools/backend_lib.C | 1 - 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/checkin_notes b/checkin_notes index 1330b8f8d8..29288d6756 100755 --- a/checkin_notes +++ b/checkin_notes @@ -22427,3 +22427,9 @@ David 8 Jan 2005 sched/ sched_config.C,h sched_locality.C + +David 9 Jan 2005 + - fix memory leak in get_insert_id() + + db/ + db_base.C diff --git a/db/db_base.C b/db/db_base.C index 53cc3e8d28..191c650646 100644 --- a/db/db_base.C +++ b/db/db_base.C @@ -48,15 +48,11 @@ int DB_CONN::insert_id() { MYSQL_ROW row; MYSQL_RES* rp; - if (mysql) { - retval = do_query("select HIGH_PRIORITY LAST_INSERT_ID()"); - } else { - retval = do_query("select LAST_INSERT_ID()"); - } - + retval = do_query("select LAST_INSERT_ID()"); if (retval) return retval; rp = mysql_store_result(mysql); row = mysql_fetch_row(rp); + mysql_free_result(rp); return atoi(row[0]); } @@ -249,10 +245,10 @@ int DB_BASE::get_integer(char* query, int& n) { resp = mysql_store_result(db->mysql); if (!resp) return ERR_DB_NOT_FOUND; row = mysql_fetch_row(resp); + mysql_free_result(resp); if (!row) return ERR_DB_NOT_FOUND; if (!row[0]) return ERR_DB_NOT_FOUND; n = atoi(row[0]); - mysql_free_result(resp); return 0; } @@ -266,10 +262,10 @@ int DB_BASE::get_double(char* query, double& x) { resp = mysql_store_result(db->mysql); if (!resp) return ERR_DB_NOT_FOUND; row = mysql_fetch_row(resp); + mysql_free_result(resp); if (!row) return ERR_DB_NOT_FOUND; if (!row[0]) return ERR_DB_NOT_FOUND; x = atof(row[0]); - mysql_free_result(resp); return 0; } diff --git a/tools/backend_lib.C b/tools/backend_lib.C index ec9aaec2a3..e85b20e1e4 100644 --- a/tools/backend_lib.C +++ b/tools/backend_lib.C @@ -156,7 +156,6 @@ static int process_wu_template( ) { char* p; char buf[LARGE_BLOB_SIZE], md5[33], path[256], url[256], top_download_path[256]; - //char out[LARGE_BLOB_SIZE]; std::string out; int retval, file_number; double nbytes;