[brasero] Fix #605433 - [PATCH] Fix some leaks in the CAM code Patch by Joe Marcus Clarke
- From: Philippe Rouquier <philippr src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [brasero] Fix #605433 - [PATCH] Fix some leaks in the CAM code Patch by Joe Marcus Clarke
- Date: Thu, 7 Jan 2010 16:38:09 +0000 (UTC)
commit 1228a90861d008bca054c837f13595242531e951
Author: Philippe Rouquier <bonfire-app wanadoo fr>
Date: Thu Jan 7 17:33:12 2010 +0100
Fix #605433 - [PATCH] Fix some leaks in the CAM code
Patch by Joe Marcus Clarke
libbrasero-media/scsi-cam.c | 11 +++++++++++
1 files changed, 11 insertions(+), 0 deletions(-)
---
diff --git a/libbrasero-media/scsi-cam.c b/libbrasero-media/scsi-cam.c
index 9d2f2ad..d9370f2 100644
--- a/libbrasero-media/scsi-cam.c
+++ b/libbrasero-media/scsi-cam.c
@@ -184,6 +184,8 @@ brasero_device_handle_open (const gchar *path,
handle->fd = fd;
}
else {
+ int serrno;
+
if (code) {
if (errno == EAGAIN
|| errno == EWOULDBLOCK
@@ -193,6 +195,15 @@ brasero_device_handle_open (const gchar *path,
*code = BRASERO_SCSI_ERRNO;
}
+ serrno = errno;
+
+ if (fd > -1)
+ close (fd);
+ if (cam)
+ cam_close_device (cam);
+
+ errno = serrno;
+
return NULL;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]