[PATCH 05/14] lib: math: fix return path (numstack may be NULL)

Lucas Stach dev at lynxeye.de
Fri Feb 7 03:48:47 EST 2014


Signed-off-by: Lucas Stach <dev at lynxeye.de>
---
 lib/math.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/math.c b/lib/math.c
index a4731ed..2e53b09 100644
--- a/lib/math.c
+++ b/lib/math.c
@@ -546,8 +546,8 @@ static arith_t evaluate_string(arith_state_t *math_state, const char *expr)
 	arith_t result;
 
 	if (numstack == NULL || stack == NULL) {
-		errmsg = "out of memory";
-		goto err_with_custom_msg;
+		math_state->errmsg = "out of memory";
+		return -1;
 	}
 
 	/* Start with a left paren */
-- 
1.8.5.3




More information about the barebox mailing list