2
0
Эх сурвалжийг харах

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

Ovidiu Sas 12 жил өмнө
parent
commit
a331af1151

+ 4 - 1
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)
 void destroy_http_db(ph_framework_t *framework_data)
 {
 {
 	int i;
 	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 */
 	/* close the DB connections */
 	for(i=0;i<framework_data->ph_db_urls_size;i++){
 	for(i=0;i<framework_data->ph_db_urls_size;i++){
 		if (ph_db_urls[i].http_db_handle) {
 		if (ph_db_urls[i].http_db_handle) {