Browse code

core: cfg.lex - free after log message

(cherry picked from commit 563c6f69aef22a90fc7870398fcfbd4242e33779)
(cherry picked from commit d9eb361ebc07a84f5a36fdad4c0a576b341d351c)

Daniel-Constantin Mierla authored on 08/04/2021 07:36:02 • Henning Westerholt committed on 22/10/2021 11:43:59
Showing 1 changed files
... ...
@@ -1630,13 +1630,14 @@ static int sr_push_yy_state(char *fin, int mode)
1630 1630
 		fp = fopen(newf, "r" );
1631 1631
 		if ( fp==NULL )
1632 1632
 		{
1633
-			pkg_free(newf);
1634 1633
 			if(mode==0)
1635 1634
 			{
1636 1635
 				LM_CRIT("cannot open included file: %s (%s)\n", fbuf, newf);
1636
+				pkg_free(newf);
1637 1637
 				return -1;
1638 1638
 			} else {
1639 1639
 				LM_DBG("importing file ignored: %s (%s)\n", fbuf, newf);
1640
+				pkg_free(newf);
1640 1641
 				return 0;
1641 1642
 			}
1642 1643
 		}