Skip to content

Commit

Permalink
src: fix bug in MallocedBuffer constructor
Browse files Browse the repository at this point in the history
This should be a generic type even though we are
currently only using `char` as `T`.

PR-URL: #23434
Reviewed-By: Sakthipriyan Vairamani <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Refael Ackermann <[email protected]>
Reviewed-By: Gireesh Punathil <[email protected]>
Reviewed-By: James M Snell <[email protected]>
  • Loading branch information
tniessen authored and MylesBorins committed Oct 30, 2018
1 parent 8e198f0 commit 8cd41aa
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/util.h
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@ struct MallocedBuffer {

MallocedBuffer() : data(nullptr) {}
explicit MallocedBuffer(size_t size) : data(Malloc<T>(size)), size(size) {}
MallocedBuffer(char* data, size_t size) : data(data), size(size) {}
MallocedBuffer(T* data, size_t size) : data(data), size(size) {}
MallocedBuffer(MallocedBuffer&& other) : data(other.data), size(other.size) {
other.data = nullptr;
}
Expand Down

0 comments on commit 8cd41aa

Please sign in to comment.