summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2004-02-16 19:30:13 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2004-02-16 19:30:13 +0000
commitd1769aaab63dcb4c5074ba90eb00807c25b0366e (patch)
tree174429c9b2afc8b38ddae261a6f5562741758903
parent2bb013b51f463df9667377661e99e01748521f2c (diff)
handle allocation failure; jjy2+@pitt.edu
-rw-r--r--usr.bin/asn1_compile/getarg.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/usr.bin/asn1_compile/getarg.c b/usr.bin/asn1_compile/getarg.c
index 86e9c447306..6a869d8ba4b 100644
--- a/usr.bin/asn1_compile/getarg.c
+++ b/usr.bin/asn1_compile/getarg.c
@@ -324,7 +324,9 @@ arg_printusage (struct getargs *args,
static void
add_string(getarg_strings *s, char *value)
{
- s->strings = realloc(s->strings, (s->num_strings + 1) * sizeof(*s->strings));
+ if ((s->strings = realloc(s->strings, (s->num_strings + 1) *
+ sizeof(*s->strings))) == NULL)
+ err(1, "realloc");
s->strings[s->num_strings] = value;
s->num_strings++;
}