Merge pull request #236 from beakeyz/memleakfix_disk_create_index

Fixed little memory leak in the UEFI build
This commit is contained in:
mint 2022-11-19 00:37:55 +01:00 committed by GitHub
commit 15127263ca
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -648,15 +648,18 @@ fail:
volume_index[volume_index_i++] = block;
struct volume _p;
for (int part = 0; ; part++) {
struct volume *p = ext_mem_alloc(sizeof(struct volume));
int ret = part_get(p, block, part);
int ret = part_get(&_p, block, part);
if (ret == END_OF_TABLE || ret == INVALID_TABLE)
break;
if (ret == NO_PARTITION)
continue;
struct volume *p = ext_mem_alloc(sizeof(struct volume));
memcpy(p, &_p, sizeof(struct volume));
volume_index[volume_index_i++] = p;
block->max_partition++;