summaryrefslogtreecommitdiffstats
path: root/src/ewf.c
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2014-02-01 10:12:01 +0100
committerChristophe Grenier <grenier@cgsecurity.org>2014-02-01 10:12:01 +0100
commitb7070ed9b2c1f7265e8ab537c9aacb948a8a5513 (patch)
tree95bb226444ac55c590fe51b17131313ca37993c0 /src/ewf.c
parent6a4dc80c3c330acb6f65ddfbf05f8a342d7af4cd (diff)
src/ewf.c: Handle failed libewf_handle_open() in RW mode
Diffstat (limited to 'src/ewf.c')
-rw-r--r--src/ewf.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/ewf.c b/src/ewf.c
index e68debc..195b54f 100644
--- a/src/ewf.c
+++ b/src/ewf.c
@@ -182,13 +182,17 @@ disk_t *fewf_init(const char *device, const int mode)
LIBEWF_OPEN_READ_WRITE,
NULL ) != 1 )
{
- log_error("libewf_handle_open(%s) failed\n", device);
+ log_error("libewf_handle_open(%s) in RW mode failed\n", device);
+ libewf_handle_free(
+ &( data->handle ),
+ NULL );
+ data->handle=NULL;
}
#else
data->handle=libewf_open(filenames, num_files, LIBEWF_OPEN_READ_WRITE);
if(data->handle==NULL)
{
- log_error("libewf_open(%s) failed\n", device);
+ log_error("libewf_open(%s) in RW mode failed\n", device);
}
#endif /* defined( HAVE_LIBEWF_V2_API ) */
}
@@ -216,7 +220,7 @@ disk_t *fewf_init(const char *device, const int mode)
LIBEWF_OPEN_READ,
NULL ) != 1 )
{
- log_error("libewf_handle_open(%s) failed\n", device);
+ log_error("libewf_handle_open(%s) in RO mode failed\n", device);
libewf_handle_free(
&( data->handle ),
@@ -233,7 +237,7 @@ disk_t *fewf_init(const char *device, const int mode)
data->handle=libewf_open(filenames, num_files, LIBEWF_OPEN_READ);
if(data->handle==NULL)
{
- log_error("libewf_open(%s) failed\n", device);
+ log_error("libewf_open(%s) in RO mode failed\n", device);
#if defined( HAVE_GLOB_H )
globfree(&globbuf);
#endif