projects
/
tools
/
apitrace.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
632a78d
)
Preserve non-NULL arrays, even when length is zero.
author
José Fonseca
<jose.r.fonseca@gmail.com>
Thu, 19 Apr 2012 16:21:23 +0000
(17:21 +0100)
committer
José Fonseca
<jose.r.fonseca@gmail.com>
Thu, 19 Apr 2012 16:21:23 +0000
(17:21 +0100)
retrace/retrace.hpp
patch
|
blob
|
history
diff --git
a/retrace/retrace.hpp
b/retrace/retrace.hpp
index
c1e556a
..
4ee1a61
100644
(file)
--- a/
retrace/retrace.hpp
+++ b/
retrace/retrace.hpp
@@
-101,9
+101,8
@@
public:
inline void *
alloc(size_t size) {
- if (!size) {
- return NULL;
- }
+ /* Always return valid address, even when size is zero */
+ size = std::max(size, sizeof(uintptr_t));
uintptr_t * buf = static_cast<uintptr_t *>(malloc(sizeof(uintptr_t) + size));
if (!buf) {