Przeglądaj źródła

Make sure we don't leak cpu_name values

Samuel Thibault 5 lat temu
rodzic
commit
11cc57f88c
1 zmienionych plików z 4 dodań i 0 usunięć
  1. 4 0
      src/core/topology.c

+ 4 - 0
src/core/topology.c

@@ -1983,7 +1983,11 @@ int _starpu_bind_thread_on_cpu(int cpuid STARPU_ATTRIBUTE_UNUSED, int workerid S
 		{
 			cpu_worker[cpuid] = workerid;
 			if (name)
+			{
+				if (cpu_name[cpuid])
+					free(cpu_name[cpuid]);
 				cpu_name[cpuid] = strdup(name);
+			}
 		}
 	}