summaryrefslogtreecommitdiff
path: root/usr.bin/asn1_compile/getarg.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr.bin/asn1_compile/getarg.c')
-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++;
}