udf_fs.c: was freeing freed memory when searching for a file that

doesn't exist.

udf2.c: print error when looking for a non-existent file.
This commit is contained in:
rocky
2006-04-11 06:46:29 +00:00
parent d0d5ea424f
commit f66b71db63
2 changed files with 10 additions and 4 deletions

View File

@@ -1,5 +1,5 @@
/*
$Id: udf2.c,v 1.4 2006/04/11 01:02:18 rocky Exp $
$Id: udf2.c,v 1.5 2006/04/11 06:46:29 rocky Exp $
Copyright (C) 2005, 2006 Rocky Bernstein <rockyb@users.sourceforge.net>
@@ -106,6 +106,12 @@ main(int argc, const char *argv[])
}
p_udf_file = udf_fopen(p_udf_root, psz_udf_fname);
if (!p_udf_file) {
fprintf(stderr, "Sorry, couldn't find %s in %s\n",
psz_udf_fname, psz_udf_image);
return 2;
}
print_file_info(p_udf_file, udf_get_filename(p_udf_file));
{
long unsigned int i_file_length = udf_get_file_length(p_udf_file);

View File

@@ -1,5 +1,5 @@
/*
$Id: udf_fs.c,v 1.17 2006/04/11 05:47:58 rocky Exp $
$Id: udf_fs.c,v 1.18 2006/04/11 06:46:29 rocky Exp $
Copyright (C) 2005 Rocky Bernstein <rocky@panix.com>
@@ -210,7 +210,7 @@ udf_ff_traverse(udf_dirent_t *p_udf_dirent, char *psz_token)
udf_dirent_t * p_udf_dirent3 =
udf_ff_traverse(p_udf_dirent2, next_tok);
if (!p_udf_dirent3) udf_dirent_free(p_udf_dirent2);
/* if p_udf_dirent3 is null p_udf_dirent2 is free'd. */
return p_udf_dirent3;
}
}