Browse Source

heteroprio: correct memory allocation to avoid leak

Ludovic PAILLAT 3 years ago
parent
commit
66ba21c539
1 changed files with 1 additions and 3 deletions
  1. 1 3
      src/sched_policies/heteroprio.c

+ 1 - 3
src/sched_policies/heteroprio.c

@@ -1010,8 +1010,8 @@ static void starpu_autoheteroprio_add_task(struct _starpu_heteroprio_data *hp, c
 	check_heteroprio_mapping(hp); // ensures that priorities are correctly mapped
 }
 
-static char *_heteroprio_data_dir = NULL;
 #define _HETEROPRIO_DIR_MAXLEN 256
+static char _heteroprio_data_dir[_HETEROPRIO_DIR_MAXLEN];
 
 /* Try to get the name of the program, to get specific data file for each program */
 #ifdef STARPU_HAVE_PROGRAM_INVOCATION_SHORT_NAME
@@ -1026,8 +1026,6 @@ static char *_starpu_heteroprio_get_data_dir()
 
 	if(!directory_existence_was_tested)
 	{
-		_STARPU_MALLOC(_heteroprio_data_dir, _HETEROPRIO_DIR_MAXLEN);
-
 		char *path = starpu_getenv("STARPU_HETEROPRIO_DATA_DIR");
 		if(path)
 		{