diff --git a/liblog/local_logger.c b/liblog/local_logger.c index 522867d4f..563cb3f9b 100644 --- a/liblog/local_logger.c +++ b/liblog/local_logger.c @@ -222,6 +222,7 @@ static int LogBufferLog(struct LogBuffer* log, log->last[logId] = node->prev; } list_remove(node); + LOG_ALWAYS_FATAL_IF(node == log->last[logId], "corrupted list"); free(e); } /* add entry to list */ diff --git a/liblog/logprint.c b/liblog/logprint.c index b62f8b446..a2839bfb6 100644 --- a/liblog/logprint.c +++ b/liblog/logprint.c @@ -250,6 +250,7 @@ LIBLOG_ABI_PUBLIC void android_log_format_free(AndroidLogFormat* p_format) { while (!list_empty(&convertHead)) { struct listnode* node = list_head(&convertHead); list_remove(node); + LOG_ALWAYS_FATAL_IF(node == list_head(&convertHead), "corrupted list"); free(node); } }