Fix double free() - regression introduced in bf83ac2662

This commit is contained in:
Christophe Grenier 2013-06-04 08:43:17 +02:00
parent 65dbe3d4ba
commit 79bf6ce3e1

View file

@ -117,10 +117,7 @@ list_disk_t *insert_new_disk(list_disk_t *list_disk, disk_t *disk_car)
{ {
if(strcmp(cur->disk->device,disk_car->device)==0) if(strcmp(cur->disk->device,disk_car->device)==0)
{ {
if(disk_car->clean!=NULL) disk_car->clean(disk_car);
disk_car->clean(disk_car);
free(disk_car->device);
free(disk_car);
return list_disk; return list_disk;
} }
} }