]> err.no Git - util-linux/commitdiff
wall: use xalloc lib
authorDavidlohr Bueso <dave@gnu.org>
Mon, 29 Nov 2010 12:27:04 +0000 (09:27 -0300)
committerKarel Zak <kzak@redhat.com>
Tue, 30 Nov 2010 12:18:18 +0000 (13:18 +0100)
Signed-off-by: Davidlohr Bueso <dave@gnu.org>
login-utils/wall.c

index 38c544266eb63567b33f024bff98d8b508fbacac..0f43495134159ec5275e704f0eb19112f85ce763 100644 (file)
@@ -58,6 +58,7 @@
 #include <utmp.h>
 
 #include "nls.h"
+#include "xalloc.h"
 #include "strutils.h"
 #include "ttymsg.h"
 #include "pathnames.h"
@@ -242,10 +243,8 @@ makemsg(fname)
                exit(1);
        }
        mbufsize = sbuf.st_size;
-       if (!(mbuf = malloc((u_int)mbufsize))) {
-               (void)fprintf(stderr, _("%s: Out of memory!\n"), progname);
-               exit(1);
-       }
+       mbuf = xmalloc(mbufsize);
+
        if (fread(mbuf, sizeof(*mbuf), mbufsize, fp) != mbufsize) {
                (void)fprintf(stderr, _("%s: can't read temporary file.\n"), progname);
                exit(1);