Skip to content

Commit

Permalink
Fixed OOM double count in umm_realloc. (esp8266#7768)
Browse files Browse the repository at this point in the history
  • Loading branch information
mhightower83 authored Dec 14, 2020
1 parent 9eb618e commit dd8c2e6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions cores/esp8266/umm_malloc/umm_malloc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1038,7 +1038,7 @@ void *umm_realloc( void *ptr, size_t size ) {
} else {
DBGLOG_DEBUG( "realloc %i to a bigger block %i failed - return NULL and leave the old block!\n", blockSize, blocks );
/* This space intentionally left blnk */
STATS__OOM_UPDATE();
/* STATS__OOM_UPDATE() has already been called by umm_malloc_core - don't duplicate count */
}
/* This is not accurate for OOM case; however, it will work for
* stopping a call to free before return.
Expand Down Expand Up @@ -1117,7 +1117,7 @@ void *umm_realloc( void *ptr, size_t size ) {
} else {
DBGLOG_DEBUG( "realloc %d to a bigger block %d failed - return NULL and leave the old block!\n", blockSize, blocks );
/* This space intentionally left blnk */
STATS__OOM_UPDATE();
/* STATS__OOM_UPDATE() has already been called by umm_malloc_core - don't duplicate count */
}
/* This is not accurate for OOM case; however, it will work for
* stopping a call to free before return.
Expand All @@ -1142,7 +1142,7 @@ void *umm_realloc( void *ptr, size_t size ) {
} else {
DBGLOG_DEBUG( "realloc %d to a bigger block %d failed - return NULL and leave the old block!\n", blockSize, blocks );
/* This space intentionally left blnk */
STATS__OOM_UPDATE();
/* STATS__OOM_UPDATE() has already been called by umm_malloc_core - don't duplicate count */
}
/* This is not accurate for OOM case; however, it will work for
* stopping a call to free before return.
Expand Down

0 comments on commit dd8c2e6

Please sign in to comment.