]> git.cworth.org Git - fips/blobdiff - execute.c
Add xmalloc function
[fips] / execute.c
index cc01c436db2329e19184a7d651b3fe5e06efe5aa..07fd30f4e26f2d282032e4702e42cdecb8ee910a 100644 (file)
--- a/execute.c
+++ b/execute.c
@@ -36,6 +36,7 @@
 #include <gelf.h>
 
 #include "execute.h"
+#include "xmalloc.h"
 
 /* Terminate a string representing a filename at the final '/' to
  * eliminate the final filename component, (leaving only the directory
@@ -294,11 +295,7 @@ execute_with_fips_preload (int argc, char * const argv[])
        char **execvp_args;
        int i;
 
-       execvp_args = malloc((argc + 1) * sizeof(char *));
-       if (execvp_args == NULL) {
-               fprintf (stderr, "Out of memory,\n");
-               return 1;
-       }
+       execvp_args = xmalloc((argc + 1) * sizeof(char *));
 
        for (i = 0; i < argc; i++) {
                execvp_args[i] = argv[i];