libcdio-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Libcdio-devel] [PATCH 2/2] udf: fix memory leak in udf_open()


From: Pete Batard
Subject: [Libcdio-devel] [PATCH 2/2] udf: fix memory leak in udf_open()
Date: Mon, 16 Jan 2012 23:29:35 +0000
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:8.0) Gecko/20111105 Thunderbird/8.0

Follow up to previous patch with a leak in udf_open().

This can be problematic if you call on udf_open() with an image, to find out if it's UDF or not for instance.

Regards,

/Pete
>From 508dd1c44696954a8808e51377aff69deae7f834 Mon Sep 17 00:00:00 2001
From: Pete Batard <address@hidden>
Date: Mon, 16 Jan 2012 20:05:19 +0000
Subject: [PATCH] udf: fix memory leak in udf_open()

* also fix typo in udf_get_root() comment
---
 lib/udf/udf_fs.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/lib/udf/udf_fs.c b/lib/udf/udf_fs.c
index 6d1e833..e5900c7 100644
--- a/lib/udf/udf_fs.c
+++ b/lib/udf/udf_fs.c
@@ -404,6 +404,7 @@ udf_open (const char *psz_path)
   return p_udf;
 
  error:
+  cdio_stdio_destroy(p_udf->stream);
   free(p_udf);
   return NULL;
 }
@@ -473,7 +474,7 @@ udf_get_volumeset_id(udf_t *p_udf, /*out*/ uint8_t 
*volsetid,
   NULL is returned if the partition is not found or a root is not found or
   there is on error.
 
-  Caller must free result - use udf_file_free for that.
+  Caller must free result - use udf_dirent_free for that.
 */
 udf_dirent_t *
 udf_get_root (udf_t *p_udf, bool b_any_partition, partition_num_t i_partition)
-- 
1.7.8.msysgit.0


reply via email to

[Prev in Thread] Current Thread [Next in Thread]