More memory management changes proposed by Joris Dobbelsteen
This commit is contained in:
parent
bcb56b5e9e
commit
dcf35bd556
@ -1 +1 @@
|
|||||||
#define Cdrskin_timestamP "2007.08.25.085709"
|
#define Cdrskin_timestamP "2007.08.25.155931"
|
||||||
|
@ -93,7 +93,7 @@ struct burn_source *burn_file_source_new(const char *path, const char *subpath)
|
|||||||
{
|
{
|
||||||
struct burn_source_file *fs;
|
struct burn_source_file *fs;
|
||||||
struct burn_source *src;
|
struct burn_source *src;
|
||||||
int fd1, fd2 = 0;
|
int fd1 = -1, fd2 = -1;
|
||||||
|
|
||||||
if (!path)
|
if (!path)
|
||||||
return NULL;
|
return NULL;
|
||||||
@ -113,15 +113,13 @@ struct burn_source *burn_file_source_new(const char *path, const char *subpath)
|
|||||||
if (fs == NULL) {
|
if (fs == NULL) {
|
||||||
failure:;
|
failure:;
|
||||||
close(fd1);
|
close(fd1);
|
||||||
if (subpath != NULL)
|
if (fd2 >= 0)
|
||||||
close(fd2);
|
close(fd2);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
fs->datafd = fd1;
|
fs->datafd = fd1;
|
||||||
|
fs->subfd = fd2;
|
||||||
if (subpath)
|
|
||||||
fs->subfd = fd2;
|
|
||||||
|
|
||||||
/* ts A70125 */
|
/* ts A70125 */
|
||||||
fs->fixed_size = 0;
|
fs->fixed_size = 0;
|
||||||
|
@ -959,10 +959,7 @@ static int mmc_read_toc_al(struct burn_drive *d, int *alloc_len)
|
|||||||
d->status = BURN_DISC_UNSUITABLE;
|
d->status = BURN_DISC_UNSUITABLE;
|
||||||
d->toc_entries = 0;
|
d->toc_entries = 0;
|
||||||
/* Prefering memory leaks over fandangos */
|
/* Prefering memory leaks over fandangos */
|
||||||
d->toc_entry = malloc(sizeof(struct burn_toc_entry));
|
d->toc_entry = calloc(1, sizeof(struct burn_toc_entry));
|
||||||
if (d->toc_entry != NULL) /* ts A70825 */
|
|
||||||
memset(&(d->toc_entry[0]), 0,
|
|
||||||
sizeof(struct burn_toc_entry));
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -982,11 +979,9 @@ static int mmc_read_toc_al(struct burn_drive *d, int *alloc_len)
|
|||||||
ts A61007 : if re-enabled then not via Assert.
|
ts A61007 : if re-enabled then not via Assert.
|
||||||
a ssert(((dlen - 2) % 11) == 0);
|
a ssert(((dlen - 2) % 11) == 0);
|
||||||
*/
|
*/
|
||||||
d->toc_entry = malloc(d->toc_entries * sizeof(struct burn_toc_entry));
|
d->toc_entry = calloc(d->toc_entries, sizeof(struct burn_toc_entry));
|
||||||
if(d->toc_entry == NULL) /* ts A70825 */
|
if(d->toc_entry == NULL) /* ts A70825 */
|
||||||
return 0;
|
return 0;
|
||||||
for (i = 0; i < d->toc_entries; i++)
|
|
||||||
memset(&(d->toc_entry[i]), 0, sizeof(struct burn_toc_entry));
|
|
||||||
tdata = c.page->data + 4;
|
tdata = c.page->data + 4;
|
||||||
|
|
||||||
burn_print(12, "TOC:\n");
|
burn_print(12, "TOC:\n");
|
||||||
|
Loading…
Reference in New Issue
Block a user