[sr-dev] git:4.0: xhttp_pi: fix crash when checking bad configs

Ovidiu Sas osas at voipembedded.com
Mon Sep 16 22:58:45 CEST 2013


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

Author: Ovidiu Sas <osas at voipembedded.com>
Committer: Ovidiu Sas <osas at voipembedded.com>
Date:   Sun Sep 15 16:38:34 2013 -0400

xhttp_pi: fix crash when checking bad configs
(cherry picked from commit d1219dc0d0c5e2eab0672a439aa7ce6486c31ba3)

---

 modules/xhttp_pi/http_db_handler.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/modules/xhttp_pi/http_db_handler.c b/modules/xhttp_pi/http_db_handler.c
index 0a5a509..730f37d 100644
--- a/modules/xhttp_pi/http_db_handler.c
+++ b/modules/xhttp_pi/http_db_handler.c
@@ -90,8 +90,11 @@ int init_http_db(ph_framework_t *framework_data, int index)
 void destroy_http_db(ph_framework_t *framework_data)
 {
 	int i;
-	ph_db_url_t *ph_db_urls = framework_data->ph_db_urls;
+	ph_db_url_t *ph_db_urls;
+
+	if (framework_data == NULL) return;
 
+	ph_db_urls = framework_data->ph_db_urls;
 	/* close the DB connections */
 	for(i=0;i<framework_data->ph_db_urls_size;i++){
 		if (ph_db_urls[i].http_db_handle) {




More information about the sr-dev mailing list