[sr-dev] git:master: 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

Peter Dunkley peter.dunkley at crocodile-rcs.com
Wed Jan 18 11:27:03 CET 2012


Module: sip-router
Branch: master
Commit: 5e77a1a7216c2ca1697ed8f392b4d4b29aba024d
URL:    http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=5e77a1a7216c2ca1697ed8f392b4d4b29aba024d

Author: pd <peter.dunkley at crocodile-rcs.com>
Committer: pd <peter.dunkley at crocodile-rcs.com>
Date:   Wed Jan 18 10:23:49 2012 +0000

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

---

 modules_k/pua/pua_db.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/modules_k/pua/pua_db.c b/modules_k/pua/pua_db.c
index 44c5fbc..d9df1eb 100644
--- a/modules_k/pua/pua_db.c
+++ b/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);
 




More information about the sr-dev mailing list