Explorar el Código

modules/presence: fix crash in main/attendant process when using presence module in library mode

Jason Penton hace 11 años
padre
commit
20302744b2
Se han modificado 1 ficheros con 5 adiciones y 5 borrados
  1. 5 5
      modules/presence/presence.c

+ 5 - 5
modules/presence/presence.c

@@ -415,6 +415,11 @@ static int child_init(int rank)
 	if (rank==PROC_INIT || rank==PROC_TCP_MAIN)
 		return 0;
 
+	pid = my_pid();
+	
+	if(library_mode)
+		return 0;
+
 	if (rank == PROC_MAIN)
 	{
 		int i;
@@ -438,11 +443,6 @@ static int child_init(int rank)
 		return 0;
 	}
 
-	pid = my_pid();
-	
-	if(library_mode)
-		return 0;
-
 	if (pa_dbf.init==0)
 	{
 		LM_CRIT("child_init: database not bound\n");