file_system/ext2 Fix checking wrong allocation

* Test the correct allocation before returning no memory

Change-Id: Id4422dab2e99487e015e1d915bfba5c18d1b8030
Reviewed-on: https://review.haiku-os.org/c/1044
Reviewed-by: Adrien Destugues <[email protected]>
This commit is contained in:
Rob Gill
2019-02-13 10:26:43 +00:00
committed by Stephan Aßmus
parent a5e9253fe0
commit a58cb2eff7
@@ -530,7 +530,7 @@ Journal::_WriteTransactionToLog()
"the commit block, block size %" B_PRIu32 "\n", fBlockSize);
JournalHeader* commitBlock =
(JournalHeader*)new(std::nothrow) uint8[fBlockSize];
if (descriptorBlock == NULL) {
if (commitBlock == NULL) {
TRACE("Journal::_WriteTransactionToLog(): Failed to allocate a buffer "
"for the commit block\n");
return B_NO_MEMORY;