瀏覽代碼

xhttp_pi: fix crash when checking bad configs

Ovidiu Sas 12 年之前
父節點
當前提交
d1219dc0d0
共有 1 個文件被更改,包括 4 次插入1 次删除
  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) {