Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/external/bsd/tre/dist/lib Check error code from allocating f...



details:   https://anonhg.NetBSD.org/src/rev/6634148505d6
branches:  trunk
changeset: 357637:6634148505d6
user:      rin <rin%NetBSD.org@localhost>
date:      Sun Nov 19 12:26:25 2017 +0000

description:
Check error code from allocating function, from musl libc:
https://git.musl-libc.org/cgit/musl/commit/src/regex/regcomp.c?id=4260dfe1ecc43d92d1e6d30daa0f22bd746d1740

diffstat:

 external/bsd/tre/dist/lib/tre-compile.c |  3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diffs (13 lines):

diff -r c1392b36bfa6 -r 6634148505d6 external/bsd/tre/dist/lib/tre-compile.c
--- a/external/bsd/tre/dist/lib/tre-compile.c   Sun Nov 19 12:13:14 2017 +0000
+++ b/external/bsd/tre/dist/lib/tre-compile.c   Sun Nov 19 12:26:25 2017 +0000
@@ -594,7 +594,8 @@
                  {
                    status = tre_add_tag_right(mem, left, tag_left);
                    tnfa->tag_directions[tag_left] = TRE_TAG_MAXIMIZE;
-                   status = tre_add_tag_right(mem, right, tag_right);
+                   if (status == REG_OK)
+                     status = tre_add_tag_right(mem, right, tag_right);
                    tnfa->tag_directions[tag_right] = TRE_TAG_MAXIMIZE;
                  }
                DPRINT(("  num_tags += 2\n"));



Home | Main Index | Thread Index | Old Index