Ver código fonte

pdt(k): safety check for db handler initialization

- there can be two attepts to initialize if xmlrpc module is loaded
(cherry picked from commit 2e8d469de4253444d61cb186395d40c0fd492fe6)
Daniel-Constantin Mierla 15 anos atrás
pai
commit
4a83157af2
1 arquivos alterados com 4 adições e 0 exclusões
  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)
 static int child_init(void)
 {
 {
+	/* check if db handler is initialized */
+	if(db_con!=NULL)
+		return 0;
+
 	db_con = pdt_dbf.init(&db_url);
 	db_con = pdt_dbf.init(&db_url);
 	if(db_con==NULL)
 	if(db_con==NULL)
 	{
 	{