summaryrefslogtreecommitdiff
path: root/usr.bin/dc
diff options
context:
space:
mode:
authorOtto Moerbeek <otto@cvs.openbsd.org>2003-09-28 19:15:54 +0000
committerOtto Moerbeek <otto@cvs.openbsd.org>2003-09-28 19:15:54 +0000
commita64907e8baac898e678a6c7b9c729bd78d99e4d6 (patch)
tree4065ffb591195dfaa78af6a99929716efa8d8088 /usr.bin/dc
parentb27c163bb05c18a8d17c0508eb4e1b0aa7b73b5b (diff)
Fix error check for array store operator.
Diffstat (limited to 'usr.bin/dc')
-rw-r--r--usr.bin/dc/bcode.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/usr.bin/dc/bcode.c b/usr.bin/dc/bcode.c
index 4e5e3f2ed36..8948abfd780 100644
--- a/usr.bin/dc/bcode.c
+++ b/usr.bin/dc/bcode.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bcode.c,v 1.5 2003/09/22 14:49:16 otto Exp $ */
+/* $OpenBSD: bcode.c,v 1.6 2003/09/28 19:15:53 otto Exp $ */
/*
* Copyright (c) 2003, Otto Moerbeek <otto@drijf.net>
@@ -17,7 +17,7 @@
*/
#ifndef lint
-static const char rcsid[] = "$OpenBSD: bcode.c,v 1.5 2003/09/22 14:49:16 otto Exp $";
+static const char rcsid[] = "$OpenBSD: bcode.c,v 1.6 2003/09/28 19:15:53 otto Exp $";
#endif /* not lint */
#include <ssl/ssl.h>
@@ -770,10 +770,11 @@ store_array(void)
reg = readch();
if (0 <= reg && reg < UCHAR_MAX) {
inumber = pop_number();
+ if (inumber == NULL)
+ return;
value = pop();
- if (inumber == NULL) {
- if (value != NULL)
- stack_free_value(value);
+ if (value == NULL) {
+ free_number(inumber);
return;
}
index = get_ulong(inumber);