Browse Source

Bugfix: bitforce: Free old name when updating it on reinitialization

Luke Dashjr 13 years ago
parent
commit
9aa3f6bddd
1 changed files with 1 additions and 0 deletions
  1. 1 0
      driver-bitforce.c

+ 1 - 0
driver-bitforce.c

@@ -299,6 +299,7 @@ static bool bitforce_init(struct cgpu_info *bitforce)
 	if (likely((!memcmp(pdevbuf, ">>>ID: ", 7)) && (s = strstr(pdevbuf + 3, ">>>"))))
 	if (likely((!memcmp(pdevbuf, ">>>ID: ", 7)) && (s = strstr(pdevbuf + 3, ">>>"))))
 	{
 	{
 		s[0] = '\0';
 		s[0] = '\0';
+		free(bitforce->name);
 		bitforce->name = strdup(pdevbuf + 7);
 		bitforce->name = strdup(pdevbuf + 7);
 	}
 	}