Browse Source

check malloc

Troy D. Hanson 9 years ago
parent
commit
9d11692a92
1 changed files with 1 additions and 0 deletions
  1. 1 0
      src/utarray.h

+ 1 - 0
src/utarray.h

@@ -78,6 +78,7 @@ typedef struct {
 
 #define utarray_new(a,_icd) do {                                              \
   a=(UT_array*)malloc(sizeof(UT_array));                                      \
+  if (a == NULL) oom();                                                       \
   utarray_init(a,_icd);                                                       \
 } while(0)