mirror of
https://github.com/reactos/reactos.git
synced 2025-02-24 09:25:10 +00:00
[VFATLIB]
Don't leak memory svn path=/trunk/; revision=72071
This commit is contained in:
parent
5cb1fd2dda
commit
1e7ca7179c
1 changed files with 13 additions and 9 deletions
|
@ -426,16 +426,20 @@ void read_boot(DOS_FS * fs)
|
|||
|
||||
fs->label = calloc(12, sizeof(uint8_t));
|
||||
if (fs->fat_bits == 12 || fs->fat_bits == 16) {
|
||||
struct boot_sector_16 *b16 = (struct boot_sector_16 *)&b;
|
||||
if (b16->extended_sig == 0x29)
|
||||
memmove(fs->label, b16->label, 11);
|
||||
else
|
||||
fs->label = NULL;
|
||||
struct boot_sector_16 *b16 = (struct boot_sector_16 *)&b;
|
||||
if (b16->extended_sig == 0x29)
|
||||
memmove(fs->label, b16->label, 11);
|
||||
else {
|
||||
free(fs->label);
|
||||
fs->label = NULL;
|
||||
}
|
||||
} else if (fs->fat_bits == 32) {
|
||||
if (b.extended_sig == 0x29)
|
||||
memmove(fs->label, &b.label, 11);
|
||||
else
|
||||
fs->label = NULL;
|
||||
if (b.extended_sig == 0x29)
|
||||
memmove(fs->label, &b.label, 11);
|
||||
else {
|
||||
free(fs->label);
|
||||
fs->label = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
if (fs->data_clusters >
|
||||
|
|
Loading…
Reference in a new issue