diff options
author | Tom Tromey <tromey@adacore.com> | 2019-12-10 11:19:23 -0700 |
---|---|---|
committer | Tom Tromey <tromey@adacore.com> | 2019-12-12 12:36:57 -0700 |
commit | d61df89700bcf1633ca9db0ea403c2108c3cac3e (patch) | |
tree | e9a230f46ba6995eb090ae026af1c6e46cf8ab97 /gdb/utils.c | |
parent | db3ad2f031d4da70db35977abbcede0399d81d6b (diff) | |
download | gdb-d61df89700bcf1633ca9db0ea403c2108c3cac3e.zip gdb-d61df89700bcf1633ca9db0ea403c2108c3cac3e.tar.gz gdb-d61df89700bcf1633ca9db0ea403c2108c3cac3e.tar.bz2 |
Remove some calls to malloc_failure
I noticed a couple of spots that call malloc_failure, but that don't
need to.
* In xml-support.c, "concat" uses xmalloc, so cannot return NULL.
* In utils.c, "buildargv" also uses xmalloc, so can only return NULL
if the argument is empty.
Tested by the buildbot.
gdb/ChangeLog
2019-12-12 Tom Tromey <tromey@adacore.com>
* xml-support.c (xml_fetch_content_from_file): Don't call
malloc_failure.
* utils.h (class gdb_argv): Remove malloc_failure comment.
* utils.c (gdb_argv::reset): Don't call malloc_failure.
Change-Id: I59483620deb6609ccf2f024d94a29113bb62d1a9
Diffstat (limited to 'gdb/utils.c')
-rw-r--r-- | gdb/utils.c | 3 |
1 files changed, 0 insertions, 3 deletions
diff --git a/gdb/utils.c b/gdb/utils.c index f7fae35..0b8ec02 100644 --- a/gdb/utils.c +++ b/gdb/utils.c @@ -3033,9 +3033,6 @@ gdb_argv::reset (const char *s) { char **argv = buildargv (s); - if (s != NULL && argv == NULL) - malloc_failure (0); - freeargv (m_argv); m_argv = argv; } |