.
[glibc/history.git] / posix / bug-regex15.c
blob8f6d3cc00d73f897766de94a20a5eb002138914e
1 /* Test for memory/CPU leak in regcomp. */
3 #include <error.h>
4 #include <sys/types.h>
5 #include <regex.h>
6 #include <stdio.h>
7 #include <stdlib.h>
9 #define TEST_DATA_LIMIT (32 << 20)
11 static int do_test (void);
12 #define TEST_FUNCTION do_test ()
13 #include "../test-skeleton.c"
15 static int
16 do_test (void)
18 regex_t re;
19 int reerr;
21 reerr = regcomp (&re, "^6?3?[25]?5?[14]*[25]*[69]*+[58]*87?4?$",
22 REG_EXTENDED | REG_NOSUB);
23 if (reerr != 0)
25 char buf[100];
26 regerror (reerr, &re, buf, sizeof buf);
27 printf ("regerror %s\n", buf);
28 return 1;
31 return 0;