numactl/numactl-2.0.7-numademo-alloc.patch

16 lines
508 B
Diff
Raw Normal View History

2012-05-19 11:19:36 +00:00
diff -up numactl-2.0.7/numademo.c.orig numactl-2.0.7/numademo.c
--- numactl-2.0.7/numademo.c.orig 2012-02-15 11:47:10.617212257 +0100
+++ numactl-2.0.7/numademo.c 2012-02-15 11:47:38.570214219 +0100
@@ -156,6 +156,11 @@ void memtest(char *name, unsigned char *
int i;
char title[128], result[128];
+ if (!mem) {
+ fprintf(stderr,"Failed to allocate %lu bytes of memory. Test \"%s\" exits.\n", msize, name);
+ return;
+ }
+
#ifdef HAVE_STREAM_LIB
if (thistest == STREAM) {
do_stream(name, mem);