Quellcode durchsuchen

xhttp_pi: fix crash when checking bad configs

Ovidiu Sas vor 12 Jahren
Ursprung
Commit
d1219dc0d0
1 geänderte Dateien mit 4 neuen und 1 gelöschten Zeilen
  1. 4 1
      modules/xhttp_pi/http_db_handler.c

+ 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)
 {
 	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) {