diff --git a/tools/vsh.c b/tools/vsh.c index ec46b822c5..89ba9a487f 100644 --- a/tools/vsh.c +++ b/tools/vsh.c @@ -129,17 +129,9 @@ _vshMalloc(vshControl *ctl, size_t size, const char *filename, int line) } void * -_vshCalloc(vshControl *ctl, size_t nmemb, size_t size, const char *filename, - int line) +vshCalloc(vshControl *ctl G_GNUC_UNUSED, size_t nmemb, size_t size) { - char *x; - - if (!xalloc_oversized(nmemb, size) && - VIR_ALLOC_N(x, nmemb * size) == 0) - return x; - vshError(ctl, _("%s: %d: failed to allocate %d bytes"), - filename, line, (int) (size*nmemb)); - exit(EXIT_FAILURE); + return g_malloc0_n(nmemb, size); } int diff --git a/tools/vsh.h b/tools/vsh.h index ad783e24b7..b6ac070f10 100644 --- a/tools/vsh.h +++ b/tools/vsh.h @@ -468,10 +468,7 @@ char * vshReadline(vshControl *ctl, const char *prompt); void *_vshMalloc(vshControl *ctl, size_t sz, const char *filename, int line); #define vshMalloc(_ctl, _sz) _vshMalloc(_ctl, _sz, __FILE__, __LINE__) -void *_vshCalloc(vshControl *ctl, size_t nmemb, size_t sz, - const char *filename, int line); -#define vshCalloc(_ctl, _nmemb, _sz) \ - _vshCalloc(_ctl, _nmemb, _sz, __FILE__, __LINE__) +void *vshCalloc(vshControl *ctl, size_t nmemb, size_t sz); /* Macros to help dealing with mutually exclusive options. */