]> git.cworth.org Git - fips/blobdiff - metrics.c
Add xmalloc function
[fips] / metrics.c
index 77d7321b7f7e393682d9ef76abb314eddd6da74e..09083e639ab966d6e80c36845c8da3c76f447059 100644 (file)
--- a/metrics.c
+++ b/metrics.c
@@ -29,6 +29,7 @@
 #include "fips-dispatch-gl.h"
 
 #include "metrics.h"
+#include "xmalloc.h"
 
 typedef struct counter
 {
@@ -116,11 +117,7 @@ metrics_counter_start (void)
 {
        counter_t *counter;
 
-       counter = malloc (sizeof(counter_t));
-       if (counter == NULL) {
-               fprintf (stderr, "Out of memory\n");
-               exit (1);
-       }
+       counter = xmalloc (sizeof(counter_t));
 
        glGenQueries (1, &counter->id);