Browse code

app_perl: check returned my_perl value on reload

- related to GH #3134

Daniel-Constantin Mierla authored on 07/07/2022 06:12:33
Showing 1 changed files
... ...
@@ -283,6 +283,13 @@ int perl_reload(void)
283 283
 	}
284 284
 	my_perl = parser_init();
285 285
 
286
+	if(my_perl) {
287
+		LM_DBG("new perl interpreter initialized\n");
288
+	} else {
289
+		LM_CRIT("failed to initialize a new perl interpreter - exiting\n");
290
+		exit(-1);
291
+	}
292
+
286 293
 #ifdef PERL_EXIT_DESTRUCT_END
287 294
 	PL_exit_flags |= PERL_EXIT_DESTRUCT_END;
288 295
 #else
... ...
@@ -291,13 +298,7 @@ int perl_reload(void)
291 298
 	PL_exit_flags |= PERL_EXIT_EXPECTED;
292 299
 #endif
293 300
 
294
-	if(my_perl) {
295
-		LM_DBG("new perl interpreter initialized\n");
296
-		return 0;
297
-	} else {
298
-		LM_CRIT("failed to initialize a new perl interpreter - exiting\n");
299
-		exit(-1);
300
-	}
301
+	return 0;
301 302
 }
302 303
 
303 304