From 2cd316911309e3db4007aa224f7874bfbeb14032 Mon Sep 17 00:00:00 2001 From: Sergey Vojtovich Date: Mon, 18 Dec 2017 17:15:48 +0400 Subject: 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. --- strings/xml.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'strings/xml.c') 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; } } -- cgit v1.2.1