summaryrefslogtreecommitdiff
path: root/klm/util/scoped.hh
diff options
context:
space:
mode:
Diffstat (limited to 'klm/util/scoped.hh')
-rw-r--r--klm/util/scoped.hh2
1 files changed, 1 insertions, 1 deletions
diff --git a/klm/util/scoped.hh b/klm/util/scoped.hh
index 12e6652b..93e2e817 100644
--- a/klm/util/scoped.hh
+++ b/klm/util/scoped.hh
@@ -50,7 +50,7 @@ class scoped_malloc {
void call_realloc(std::size_t to) {
void *ret;
- UTIL_THROW_IF(!(ret = std::realloc(p_, to)), util::ErrnoException, "realloc to " << to << " bytes failed.");
+ UTIL_THROW_IF(!(ret = std::realloc(p_, to)) && to, util::ErrnoException, "realloc to " << to << " bytes failed.");
p_ = ret;
}