forked from Imagelibrary/binutils-gdb
* utils.c (xmalloc,xcalloc,xstrdup): New fns.
* server.h (ATTR_MALLOC): New macro. (xmalloc,xcalloc,xstrdup): Declare. * hostio.c: Replace malloc,calloc,strdup with xmalloc,xcalloc,xstrdup. * inferiors.c: Ditto. * linux-low.c: Ditto. * mem-break.c: Ditto. * regcache.c: Ditto. * remote-utils.c: Ditto. * server.c: Ditto. * target.c: Ditto. * win32-low.c: Ditto.
This commit is contained in:
@@ -94,12 +94,12 @@ new_register_cache (void)
|
||||
if (register_bytes == 0)
|
||||
return NULL; /* The architecture hasn't been initialized yet. */
|
||||
|
||||
regcache = malloc (sizeof (*regcache));
|
||||
regcache = xmalloc (sizeof (*regcache));
|
||||
|
||||
/* Make sure to zero-initialize the register cache when it is created,
|
||||
in case there are registers the target never fetches. This way they'll
|
||||
read as zero instead of garbage. */
|
||||
regcache->registers = calloc (1, register_bytes);
|
||||
regcache->registers = xcalloc (1, register_bytes);
|
||||
if (regcache->registers == NULL)
|
||||
fatal ("Could not allocate register cache.");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user