From 16821f2758e779138ebfe71b17cbb77f1b1aaf38 Mon Sep 17 00:00:00 2001 From: Tobias Markus Date: Fri, 27 Feb 2015 17:30:56 +0100 Subject: [PATCH] Fix coverity #29357 --- src/supertux/statistics.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/supertux/statistics.cpp b/src/supertux/statistics.cpp index 56cb3cdf7..94d6325b0 100644 --- a/src/supertux/statistics.cpp +++ b/src/supertux/statistics.cpp @@ -74,7 +74,8 @@ Statistics::serialize_to_squirrel(HSQUIRRELVM vm) if (time != nv_time) scripting::store_float(vm, "time-needed", time); if (secrets != nv_secrets) scripting::store_int(vm, "secrets-found", secrets); if (total_secrets != nv_secrets) scripting::store_int(vm, "secrets-found-total", total_secrets); - sq_createslot(vm, -3); + if(SQ_FAILED(sq_createslot(vm, -3))) + throw scripting::SquirrelError(vm, "Couldn't create statistics table"); } void -- 2.11.0