summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorLucas Stach <dev@lynxeye.de>2014-02-07 09:48:47 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2014-02-10 08:49:55 +0100
commitefe314434ff54542b6939b52b86c01e820add044 (patch)
tree764ef1ba3f2f0e970c867dfa609be46b33b3acf7 /lib
parent13517cbcf044a11f62776192cf190e6e566e5d09 (diff)
downloadbarebox-efe314434ff54542b6939b52b86c01e820add044.tar.gz
barebox-efe314434ff54542b6939b52b86c01e820add044.tar.xz
lib: math: fix return path (numstack may be NULL)
Signed-off-by: Lucas Stach <dev@lynxeye.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'lib')
-rw-r--r--lib/math.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/math.c b/lib/math.c
index a4731edb9a..2e53b09e6c 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 */