summaryrefslogtreecommitdiff
path: root/regex
diff options
context:
space:
mode:
authormonty@mysql.com <>2003-12-17 17:35:34 +0200
committermonty@mysql.com <>2003-12-17 17:35:34 +0200
commite0cc6799ecc831d296c568c5068947c1421fcaa5 (patch)
tree93924b5aab311e02a0f0931cf91e67cdfad04bdf /regex
parent0462f48b344633c7d88d12d9667f4bd50b91c552 (diff)
parent30e318311b35b109d230f7184fe0be1b6e29f02b (diff)
downloadmariadb-git-e0cc6799ecc831d296c568c5068947c1421fcaa5.tar.gz
Merge with 4.0.17
Diffstat (limited to 'regex')
-rw-r--r--regex/reginit.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/regex/reginit.c b/regex/reginit.c
index 09ffff37ef0..74ad3dc6de4 100644
--- a/regex/reginit.c
+++ b/regex/reginit.c
@@ -49,6 +49,16 @@ void regex_init(CHARSET_INFO *cs)
for (i=0; i < CCLASS_LAST ; i++)
{
char *tmp=(char*) malloc(count[i]+1);
+ if (!tmp)
+ {
+ /*
+ This is very unlikely to happen as this function is called once
+ at program startup
+ */
+ fprintf(stderr,
+ "Fatal error: Can't allocate memory in regex_init\n");
+ exit(1);
+ }
memcpy(tmp,buff[i],count[i]*sizeof(char));
tmp[count[i]]=0;
cclasses[i].chars=tmp;