Netfs: Fix memory error

In Reader::Read(), memory is allocated to '*buffer' at line 40,
but freed with 'buffer' at line 45.
Pointed by Clang Static Analyzer.

Change-Id: I18e49791da639a6bc2041e944a39ceb73a2e5055
Reviewed-on: https://review.haiku-os.org/c/haiku/+/1931
Reviewed-by: Axel Dörfler <axeld@pinc-software.de>
This commit is contained in:
Murai Takashi 2019-10-30 20:22:23 +09:00 committed by Axel Dörfler
parent 715a29f47d
commit 61b433252a

View File

@ -42,7 +42,7 @@ Reader::Read(int32 size, void** buffer, bool* mustFree)
return B_NO_MEMORY;
status_t error = Read(*buffer, size);
if (error != B_OK) {
free(buffer);
free(*buffer);
return error;
}
return error;