summaryrefslogtreecommitdiff
path: root/strings/xml.c
diff options
context:
space:
mode:
authorSergey Vojtovich <svoj@mariadb.org>2017-12-18 17:15:48 +0400
committerSergey Vojtovich <svoj@mariadb.org>2017-12-19 19:10:54 +0400
commit2cd316911309e3db4007aa224f7874bfbeb14032 (patch)
tree53ffd4ab4d99f7ff37dfa31407c2199a222baf5c /strings/xml.c
parented7e4b68ed59fb7c34dc06625dfe378e71d1e8a7 (diff)
downloadmariadb-git-2cd316911309e3db4007aa224f7874bfbeb14032.tar.gz
MDEV-14265 - RPMLint warning: shared-lib-calls-exit
find_type_or_exit() client helper did exit(1) on error, exit(1) moved to clients. mysql_read_default_options() did exit(1) on error, error is passed through and handled now. my_str_malloc_default() did exit(1) on error, replaced my_str_ allocator functions with normal my_malloc()/my_realloc()/my_free(). sql_connect.cc did many exit(1) on hash initialisation failure. Removed error check since my_hash_init() never fails. my_malloc() did exit(1) on error. Replaced with abort(). my_load_defaults() did exit(1) on error, replaced with return 2. my_load_defaults() still does exit(0) when invoked with --print-defaults.
Diffstat (limited to 'strings/xml.c')
-rw-r--r--strings/xml.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/strings/xml.c b/strings/xml.c
index 4685a04faec..b5fed6a6760 100644
--- a/strings/xml.c
+++ b/strings/xml.c
@@ -17,6 +17,7 @@
#include "strings_def.h"
#include "m_string.h"
#include "my_xml.h"
+#include "my_sys.h"
#define MY_XML_UNKNOWN 'U'
@@ -231,13 +232,13 @@ static int my_xml_attr_ensure_space(MY_XML_PARSER *st, size_t len)
if (!st->attr.buffer)
{
- st->attr.buffer= (char *) my_str_malloc(st->attr.buffer_size);
+ st->attr.buffer= (char *) my_malloc(st->attr.buffer_size, MYF(0));
if (st->attr.buffer)
memcpy(st->attr.buffer, st->attr.static_buffer, ofs + 1 /*term. zero */);
}
else
- st->attr.buffer= (char *) my_str_realloc(st->attr.buffer,
- st->attr.buffer_size);
+ st->attr.buffer= (char *) my_realloc(st->attr.buffer,
+ st->attr.buffer_size, MYF(0));
st->attr.start= st->attr.buffer;
st->attr.end= st->attr.start + ofs;
@@ -507,7 +508,7 @@ void my_xml_parser_free(MY_XML_PARSER *p)
{
if (p->attr.buffer)
{
- my_str_free(p->attr.buffer);
+ my_free(p->attr.buffer);
p->attr.buffer= NULL;
}
}