diff options
author | 2003-09-28 19:15:53 +0000 | |
---|---|---|
committer | 2003-09-28 19:15:53 +0000 | |
commit | 2990b50ffbdeedb0817a31f838e0fc96ecd3080c (patch) | |
tree | 01b71605de44125801c0ef02de1d94c345472ddc | |
parent | sync after mtd(4) update; ok deraadt@ (diff) | |
download | wireguard-openbsd-2990b50ffbdeedb0817a31f838e0fc96ecd3080c.tar.xz wireguard-openbsd-2990b50ffbdeedb0817a31f838e0fc96ecd3080c.zip |
Fix error check for array store operator.
-rw-r--r-- | usr.bin/dc/bcode.c | 11 |
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); |