test/evp_test.c:1032: error: NULL_DEREFERENCE
  pointer `mdat` last assigned on line 1031 could be null and is dereferenced at line 1032, column 5.
Showing all 14 steps of the trace


test/evp_test.c:1020:1: start of procedure mac_test_init()
1018.   };
1019.   
1020. > static int mac_test_init(struct evp_test *t, const char *alg)
1021.   {
1022.       int type;

test/evp_test.c:1024:9: Taking true branch
1022.       int type;
1023.       struct mac_data *mdat;
1024.       if (strcmp(alg, "HMAC") == 0)
                ^
1025.           type = EVP_PKEY_HMAC;
1026.       else if (strcmp(alg, "CMAC") == 0)

test/evp_test.c:1025:9: 
1023.       struct mac_data *mdat;
1024.       if (strcmp(alg, "HMAC") == 0)
1025. >         type = EVP_PKEY_HMAC;
1026.       else if (strcmp(alg, "CMAC") == 0)
1027.           type = EVP_PKEY_CMAC;

test/evp_test.c:1031:5: 
1029.           return 0;
1030.   
1031. >     mdat = OPENSSL_malloc(sizeof(*mdat));
1032.       mdat->type = type;
1033.       mdat->alg = NULL;

crypto/mem.c:120:1: start of procedure CRYPTO_malloc()
  118.   }
  119.   
  120. > void *CRYPTO_malloc(size_t num, const char *file, int line)
  121.   {
  122.       void *ret = NULL;

crypto/mem.c:122:5: 
  120.   void *CRYPTO_malloc(size_t num, const char *file, int line)
  121.   {
  122. >     void *ret = NULL;
  123.   
  124.       if (num <= 0)

crypto/mem.c:124:9: Taking false branch
  122.       void *ret = NULL;
  123.   
  124.       if (num <= 0)
                 ^
  125.           return NULL;
  126.   

crypto/mem.c:127:5: 
  125.           return NULL;
  126.   
  127. >     allow_customize = 0;
  128.   #ifndef OPENSSL_NO_CRYPTO_MDEBUG
  129.       if (call_malloc_debug) {

crypto/mem.c:137:5: 
  135.       }
  136.   #else
  137. >     (void)file;
  138.       (void)line;
  139.       ret = malloc(num);

crypto/mem.c:138:5: 
  136.   #else
  137.       (void)file;
  138. >     (void)line;
  139.       ret = malloc(num);
  140.   #endif

crypto/mem.c:139:5: 
  137.       (void)file;
  138.       (void)line;
  139. >     ret = malloc(num);
  140.   #endif
  141.   

crypto/mem.c:154:5: 
  152.   #endif
  153.   
  154. >     return ret;
  155.   }
  156.   

crypto/mem.c:155:1: return from a call to CRYPTO_malloc
  153.   
  154.       return ret;
  155. > }
  156.   
  157.   void *CRYPTO_zalloc(size_t num, const char *file, int line)

test/evp_test.c:1032:5: 
1030.   
1031.       mdat = OPENSSL_malloc(sizeof(*mdat));
1032. >     mdat->type = type;
1033.       mdat->alg = NULL;
1034.       mdat->key = NULL;
