Explorar o código

dialplan: safety check for fetch rows before data init

Daniel-Constantin Mierla %!s(int64=15) %!d(string=hai) anos
pai
achega
5040ff5cc5
Modificáronse 1 ficheiros con 3 adicións e 3 borrados
  1. 3 3
      modules/dialplan/dialplan.c

+ 3 - 3
modules/dialplan/dialplan.c

@@ -183,14 +183,14 @@ static int mod_init(void)
 		return -1;
 	}
 
+	if(dp_fetch_rows<=0)
+		dp_fetch_rows = 1000;
+
 	if(init_data() != 0) {
 		LM_ERR("could not initialize data\n");
 		return -1;
 	}
 
-	if(dp_fetch_rows<=0)
-		dp_fetch_rows = 1000;
-
 	return 0;
 }