summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/common.c2
-rw-r--r--src/fat_adv.c2
-rw-r--r--src/fnctdsk.c3
-rw-r--r--src/phrecn.c3
4 files changed, 9 insertions, 1 deletions
diff --git a/src/common.c b/src/common.c
index 5eaa1cb..f808d5f 100644
--- a/src/common.c
+++ b/src/common.c
@@ -56,6 +56,7 @@ void *MALLOC(size_t size)
if(size<=0)
{
log_critical("Try to allocate 0 byte of memory\n");
+ log_close();
exit(EXIT_FAILURE);
}
#if defined(HAVE_POSIX_MEMALIGN)
@@ -74,6 +75,7 @@ void *MALLOC(size_t size)
if((res=malloc(size))==NULL)
{
log_critical("\nCan't allocate %lu bytes of memory.\n", (long unsigned)size);
+ log_close();
exit(EXIT_FAILURE);
}
memset(res,0,size);
diff --git a/src/fat_adv.c b/src/fat_adv.c
index 68b49b3..4742c67 100644
--- a/src/fat_adv.c
+++ b/src/fat_adv.c
@@ -1103,6 +1103,7 @@ static void create_fat_boot_sector(disk_t *disk_car, partition_t *partition, con
break;
default:
log_critical("create_fat_boot_sector: severe error\n");
+ log_close();
exit(1);
}
if(part_size>partition->part_size/disk_car->sector_size)
@@ -1217,6 +1218,7 @@ static void create_fat_boot_sector(disk_t *disk_car, partition_t *partition, con
break;
default:
log_critical("create_fat_boot_sector: severe error\n");
+ log_close();
exit(1);
}
if(memcmp(newboot,orgboot,1*DEFAULT_SECTOR_SIZE)) /* Only compare the first sector */
diff --git a/src/fnctdsk.c b/src/fnctdsk.c
index 8d158bb..3ec5738 100644
--- a/src/fnctdsk.c
+++ b/src/fnctdsk.c
@@ -215,6 +215,7 @@ int check_list_part(list_part_t *list_part)
if((list_part!=NULL) && (list_part->prev!=NULL))
{
log_critical("\ncheck_list_part error: list_part->prev!=NULL\n");
+ log_close();
exit(EXIT_FAILURE);
}
log_trace("check_list_part\n");
@@ -224,6 +225,7 @@ int check_list_part(list_part_t *list_part)
if(prev!=parts->prev)
{
log_critical("\ncheck_list_part error: prev!=parts->prev\n");
+ log_close();
exit(EXIT_FAILURE);
}
prev=parts;
@@ -231,6 +233,7 @@ int check_list_part(list_part_t *list_part)
if((prev!=NULL) && (prev->next!=NULL))
{
log_critical("\ncheck_list_part error: prev->next!=NULL\n");
+ log_close();
exit(EXIT_FAILURE);
}
return 0;
diff --git a/src/phrecn.c b/src/phrecn.c
index 91c46f6..7c980e7 100644
--- a/src/phrecn.c
+++ b/src/phrecn.c
@@ -156,6 +156,7 @@ void get_next_sector(alloc_data_t *list_search_space, alloc_data_t **current_sea
(unsigned long long)((*current_search_space)->end/512));
log_flush();
bug();
+ log_close();
exit(1);
}
#endif
@@ -971,7 +972,7 @@ static int photorec_aux(disk_t *disk_car, partition_t *partition, const int verb
(unsigned long long)(offset/disk_car->sector_size),
(unsigned long long)(current_search_space->start/disk_car->sector_size),
(unsigned long long)(current_search_space->end/disk_car->sector_size));
- log_flush();
+ log_close();
exit(1);
}
#endif