diff options
author | 2004-02-16 19:30:12 +0000 | |
---|---|---|
committer | 2004-02-16 19:30:12 +0000 | |
commit | f64b62e76bc7005f9ee79bbed0ce3075468ead43 (patch) | |
tree | 7b53c929820dce7ff83c2b45c2e0c35039dc694c | |
parent | no need for extra param; Mathias@enloco.net (diff) | |
download | wireguard-openbsd-f64b62e76bc7005f9ee79bbed0ce3075468ead43.tar.xz wireguard-openbsd-f64b62e76bc7005f9ee79bbed0ce3075468ead43.zip |
handle allocation failure; jjy2+@pitt.edu
-rw-r--r-- | usr.bin/asn1_compile/getarg.c | 4 |
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++; } |