Free memory when recovering from errors.
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
$Id: osx.c,v 1.12 2008/04/22 15:29:12 karl Exp $
|
$Id: osx.c,v 1.13 2008/08/30 06:55:50 rocky Exp $
|
||||||
|
|
||||||
Copyright (C) 2003, 2004, 2005, 2006, 2008 Rocky Bernstein <rocky@gnu.org>
|
Copyright (C) 2003, 2004, 2005, 2006, 2008 Rocky Bernstein <rocky@gnu.org>
|
||||||
from vcdimager code:
|
from vcdimager code:
|
||||||
@@ -33,7 +33,7 @@
|
|||||||
#include "config.h"
|
#include "config.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static const char _rcsid[] = "$Id: osx.c,v 1.12 2008/04/22 15:29:12 karl Exp $";
|
static const char _rcsid[] = "$Id: osx.c,v 1.13 2008/08/30 06:55:50 rocky Exp $";
|
||||||
|
|
||||||
#include <cdio/logging.h>
|
#include <cdio/logging.h>
|
||||||
#include <cdio/sector.h>
|
#include <cdio/sector.h>
|
||||||
@@ -1933,7 +1933,10 @@ cdio_open_osx (const char *psz_orig_source)
|
|||||||
|
|
||||||
if (NULL == psz_orig_source) {
|
if (NULL == psz_orig_source) {
|
||||||
psz_source=cdio_get_default_device_osx();
|
psz_source=cdio_get_default_device_osx();
|
||||||
if (NULL == psz_source) return NULL;
|
if (NULL == psz_source) {
|
||||||
|
cdio_generic_free(_data);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
_set_arg_osx(_data, "source", psz_source);
|
_set_arg_osx(_data, "source", psz_source);
|
||||||
free(psz_source);
|
free(psz_source);
|
||||||
} else {
|
} else {
|
||||||
@@ -1944,13 +1947,16 @@ cdio_open_osx (const char *psz_orig_source)
|
|||||||
#if 0
|
#if 0
|
||||||
cdio_info ("source %s is a not a device", psz_orig_source);
|
cdio_info ("source %s is a not a device", psz_orig_source);
|
||||||
#endif
|
#endif
|
||||||
|
cdio_generic_free(_data);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = cdio_new ((void *)_data, &_funcs);
|
ret = cdio_new ((void *)_data, &_funcs);
|
||||||
if (ret == NULL) return NULL;
|
if (ret == NULL) {
|
||||||
|
cdio_generic_free(_data);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
ret->driver_id = DRIVER_OSX;
|
ret->driver_id = DRIVER_OSX;
|
||||||
|
|
||||||
if (cdio_generic_init(_data, O_RDONLY) && init_osx(_data))
|
if (cdio_generic_init(_data, O_RDONLY) && init_osx(_data))
|
||||||
|
|||||||
Reference in New Issue
Block a user