More memory management changes proposed by Joris Dobbelsteen

This commit is contained in:
2007-08-25 16:02:58 +00:00
parent bcb56b5e9e
commit dcf35bd556
3 changed files with 6 additions and 13 deletions

View File

@ -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 *src;
int fd1, fd2 = 0;
int fd1 = -1, fd2 = -1;
if (!path)
return NULL;
@ -113,15 +113,13 @@ struct burn_source *burn_file_source_new(const char *path, const char *subpath)
if (fs == NULL) {
failure:;
close(fd1);
if (subpath != NULL)
if (fd2 >= 0)
close(fd2);
return NULL;
}
fs->datafd = fd1;
if (subpath)
fs->subfd = fd2;
fs->subfd = fd2;
/* ts A70125 */
fs->fixed_size = 0;