File tree Expand file tree Collapse file tree 2 files changed +10
-7
lines changed
Expand file tree Collapse file tree 2 files changed +10
-7
lines changed Original file line number Diff line number Diff line change @@ -327,6 +327,7 @@ int dp_conf_parse_file(const char *env_filename)
327327void dp_conf_free (void )
328328{
329329 free (dhcp_dns .array );
330+ free (dhcpv6_dns .array );
330331#ifdef ENABLE_VIRTSVC
331332 free (virtual_services .entries );
332333#endif
Original file line number Diff line number Diff line change @@ -34,6 +34,13 @@ static char **dp_argv;
3434static int dp_argc ;
3535static char * dp_mlx_args [4 ];
3636
37+ static void dp_args_free_mellanox (void )
38+ {
39+ for (int i = 0 ; i < 4 ; ++ i )
40+ free (dp_mlx_args [i ]);
41+ free (dp_argv );
42+ }
43+
3744static int dp_args_add_mellanox (int * orig_argc , char * * * orig_argv )
3845{
3946 int curarg ;
@@ -69,6 +76,7 @@ static int dp_args_add_mellanox(int *orig_argc, char ***orig_argv)
6976 }
7077 if (!dp_mlx_args [0 ] || !dp_mlx_args [1 ] || !dp_mlx_args [2 ] || !dp_mlx_args [3 ]) {
7178 DP_EARLY_ERR ("Cannot allocate Mellanox arguments" );
79+ dp_args_free_mellanox ();
7280 return DP_ERROR ;
7381 }
7482
@@ -85,13 +93,6 @@ static int dp_args_add_mellanox(int *orig_argc, char ***orig_argv)
8593 return DP_OK ;
8694}
8795
88- static void dp_args_free_mellanox (void )
89- {
90- for (int i = 0 ; i < 4 ; ++ i )
91- free (dp_mlx_args [i ]);
92- free (dp_argv );
93- }
94-
9596static bool dp_is_mellanox_opt_set (void )
9697{
9798 return dp_conf_get_eal_a_pf0 ()[0 ] != '\0'
@@ -268,6 +269,7 @@ int main(int argc, char **argv)
268269 eal_argcount = dp_eal_init (& argc , & argv );
269270 if (DP_FAILED (eal_argcount )) {
270271 DP_EARLY_ERR ("Failed to initialize EAL" );
272+ dp_conf_free ();
271273 return EXIT_FAILURE ;
272274 }
273275
You can’t perform that action at this time.
0 commit comments