浏览代码

pdt(k): safety check for db handler initialization

- there can be two attepts to initialize if xmlrpc module is loaded
Daniel-Constantin Mierla 15 年之前
父节点
当前提交
2e8d469de4
共有 1 个文件被更改,包括 4 次插入0 次删除
  1. 4 0
      modules_k/pdt/pdt.c

+ 4 - 0
modules_k/pdt/pdt.c

@@ -269,6 +269,10 @@ error1:
 
 static int child_init(void)
 {
+	/* check if db handler is initialized */
+	if(db_con!=NULL)
+		return 0;
+
 	db_con = pdt_dbf.init(&db_url);
 	if(db_con==NULL)
 	{