diff options
author | unknown <serg@sergbook.mylan> | 2005-01-08 21:25:31 +0100 |
---|---|---|
committer | unknown <serg@sergbook.mylan> | 2005-01-08 21:25:31 +0100 |
commit | 4c8d52aa80ce2a2131783bc2df5b02f21baa1c96 (patch) | |
tree | 2b9317949d667f9113933b7fd154a10693b5c05c | |
parent | 9ad1b390fcf12ec7aa7b9fad157d6e0a61045b40 (diff) | |
download | mariadb-git-4c8d52aa80ce2a2131783bc2df5b02f21baa1c96.tar.gz |
few harmless warnings from automated code-checking tools fixed
client/mysql.cc:
few harmless warnings from automated code-checking tools fixed
cleanup
-rw-r--r-- | client/completion_hash.cc | 3 | ||||
-rw-r--r-- | client/mysql.cc | 9 | ||||
-rw-r--r-- | cmd-line-utils/libedit/parse.c | 3 | ||||
-rw-r--r-- | pstack/pstack.c | 2 |
4 files changed, 11 insertions, 6 deletions
diff --git a/client/completion_hash.cc b/client/completion_hash.cc index 536e7f9373a..7a3b363c93c 100644 --- a/client/completion_hash.cc +++ b/client/completion_hash.cc @@ -79,7 +79,8 @@ int completion_hash_update(HashTable *ht, char *arKey, uint nKeyLength, if (!memcmp(p->arKey, arKey, nKeyLength)) { entry *n; - n = (entry *) alloc_root(&ht->mem_root,sizeof(entry)); + if (!(n = (entry *) alloc_root(&ht->mem_root,sizeof(entry)))) + return FAILURE; n->pNext = p->pData; n->str = str; p->pData = n; diff --git a/client/mysql.cc b/client/mysql.cc index 0ea0f10f5d7..bfa827a6e95 100644 --- a/client/mysql.cc +++ b/client/mysql.cc @@ -1502,7 +1502,10 @@ You can turn off this feature to get a quicker startup with -A\n\n"); if (!(field_names[i] = (char **) alloc_root(&hash_mem_root, sizeof(char *) * (num_fields*2+1)))) - break; + { + mysql_free_result(fields); + break; + } field_names[i][num_fields*2]= '\0'; j=0; while ((sql_field=mysql_fetch_field(fields))) @@ -2077,10 +2080,10 @@ print_table_data_html(MYSQL_RES *result) } while ((cur = mysql_fetch_row(result))) { + ulong *lengths=mysql_fetch_lengths(result); (void) tee_fputs("<TR>", PAGER); for (uint i=0; i < mysql_num_fields(result); i++) { - ulong *lengths=mysql_fetch_lengths(result); (void) tee_fputs("<TD>", PAGER); safe_put_field(cur[i],lengths[i]); (void) tee_fputs("</TD>", PAGER); @@ -2106,10 +2109,10 @@ print_table_data_xml(MYSQL_RES *result) fields = mysql_fetch_fields(result); while ((cur = mysql_fetch_row(result))) { + ulong *lengths=mysql_fetch_lengths(result); (void) tee_fputs("\n <row>\n", PAGER); for (uint i=0; i < mysql_num_fields(result); i++) { - ulong *lengths=mysql_fetch_lengths(result); tee_fprintf(PAGER, "\t<%s>", (fields[i].name ? (fields[i].name[0] ? fields[i].name : " ") : "NULL")); diff --git a/cmd-line-utils/libedit/parse.c b/cmd-line-utils/libedit/parse.c index b113353d464..d09b890c1ab 100644 --- a/cmd-line-utils/libedit/parse.c +++ b/cmd-line-utils/libedit/parse.c @@ -87,7 +87,8 @@ parse_line(EditLine *el, const char *line) int argc; Tokenizer *tok; - tok = tok_init(NULL); + if (!(tok = tok_init(NULL))) + return -1; tok_line(tok, line, &argc, &argv); argc = el_parse(el, argc, argv); tok_end(tok); diff --git a/pstack/pstack.c b/pstack/pstack.c index 75869686e35..4cdd80d68b5 100644 --- a/pstack/pstack.c +++ b/pstack/pstack.c @@ -1663,7 +1663,7 @@ pr_tag_type (p, name, id, kind) { struct pr_handle *info = (struct pr_handle *) p; const char *t, *tag; - char idbuf[20]; + char idbuf[30]; switch (kind) { |