Browse Source

modules_k/pua: Fix for PUA crash when the DB clean runs if there are lots of records (more than the fetch_rows amount) in the DB

- Fix by Paul Pankhurst @ Crocodile RCS
pd 13 years ago
parent
commit
5e77a1a721
1 changed files with 3 additions and 3 deletions
  1. 3 3
      modules_k/pua/pua_db.c

+ 3 - 3
modules_k/pua/pua_db.c

@@ -193,9 +193,7 @@ int clean_puadb( int update_period, int min_expires )
 		return(-1);
 	}
 
-	nr_rows = RES_ROW_N(res);
-
-	if (nr_rows == 0)
+	if (RES_ROW_N(res) == 0)
 	{
 		/* no match */ 
 		LM_INFO( "No records matched for clean\n");
@@ -204,6 +202,8 @@ int clean_puadb( int update_period, int min_expires )
 	}
 
 	do {
+		nr_rows = RES_ROW_N(res);
+
 		/* get the results and update matching entries */
 		rows = RES_ROWS(res);