summaryrefslogtreecommitdiffstats
path: root/src/rfs_dir.c
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2009-01-29 08:53:42 +0100
committerChristophe Grenier <grenier@cgsecurity.org>2009-01-29 08:53:42 +0100
commit77f095422316289af374a59423e3f0ccc9602ed3 (patch)
tree0e41c6bcd5e0bba49ea3bb3c7429f05a59cab6d0 /src/rfs_dir.c
parenta48dbbd42593f8ab889ad3fe678b5d67a2a824b7 (diff)
Fix a few memory leaks found using Coccinelle, http://www.emn.fr/x-info/coccinelle/
Diffstat (limited to 'src/rfs_dir.c')
-rw-r--r--src/rfs_dir.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/rfs_dir.c b/src/rfs_dir.c
index 6303dda..9772cad 100644
--- a/src/rfs_dir.c
+++ b/src/rfs_dir.c
@@ -119,10 +119,11 @@ char *dal_error(dal_t *dal) {
static int file_read(dal_t *dal, void *buff, blk_t block, blk_t count) {
uint64_t off;
unsigned int blocklen;
- my_data_t *my_data=(my_data_t*)dal->data;
+ my_data_t *my_data;
/* log_trace("reiser file_read(dal=%p,buff=%p,block=%ld, count=%ld)\n",dal,buff,block,count); */
if (!dal || !buff)
return 0;
+ my_data=(my_data_t*)dal->data;
#ifdef HAVE_DAL_T_BLOCK_SIZE
off = (uint64_t)block * (uint64_t)dal->block_size;
blocklen = count * dal->block_size;
@@ -212,9 +213,10 @@ static blk_t file_len(dal_t *dal) {
#else
static count_t file_len(dal_t *dal) {
#endif
- my_data_t *my_data=(my_data_t*)dal->data;
+ my_data_t *my_data;
/* log_trace("reiser file_len\n"); */
if (!dal) return 0;
+ my_data=(my_data_t*)dal->data;
#ifdef HAVE_DAL_T_BLOCK_SIZE
return my_data->partition->part_size / dal->block_size;
#else