From d1769aaab63dcb4c5074ba90eb00807c25b0366e Mon Sep 17 00:00:00 2001 From: Theo de Raadt Date: Mon, 16 Feb 2004 19:30:13 +0000 Subject: handle allocation failure; jjy2+@pitt.edu --- usr.bin/asn1_compile/getarg.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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++; } -- cgit v1.2.3