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


test/evp_test.c:1115:1: start of procedure mac_test_init()
1113.   };
1114.   
1115. > static int mac_test_init(struct evp_test *t, const char *alg)
1116.   {
1117.       int type;

test/evp_test.c:1119:9: Taking true branch
1117.       int type;
1118.       struct mac_data *mdat;
1119.       if (strcmp(alg, "HMAC") == 0) {
                ^
1120.           type = EVP_PKEY_HMAC;
1121.       } else if (strcmp(alg, "CMAC") == 0) {

test/evp_test.c:1120:9: 
1118.       struct mac_data *mdat;
1119.       if (strcmp(alg, "HMAC") == 0) {
1120. >         type = EVP_PKEY_HMAC;
1121.       } else if (strcmp(alg, "CMAC") == 0) {
1122.   #ifndef OPENSSL_NO_CMAC

test/evp_test.c:1131:5: 
1129.           return 0;
1130.   
1131. >     mdat = OPENSSL_malloc(sizeof(*mdat));
1132.       mdat->type = type;
1133.       mdat->alg = NULL;

crypto/mem.c:157:1: start of procedure CRYPTO_malloc()
  155.   #endif
  156.   
  157. > void *CRYPTO_malloc(size_t num, const char *file, int line)
  158.   {
  159.       void *ret = NULL;

crypto/mem.c:159:5: 
  157.   void *CRYPTO_malloc(size_t num, const char *file, int line)
  158.   {
  159. >     void *ret = NULL;
  160.   
  161.       if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)

crypto/mem.c:161:9: Taking false branch
  159.       void *ret = NULL;
  160.   
  161.       if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)
                 ^
  162.           return malloc_impl(num, file, line);
  163.   

crypto/mem.c:164:9: Taking false branch
  162.           return malloc_impl(num, file, line);
  163.   
  164.       if (num <= 0)
                 ^
  165.           return NULL;
  166.   

crypto/mem.c:168:5: 
  166.   
  167.       FAILTEST();
  168. >     allow_customize = 0;
  169.   #ifndef OPENSSL_NO_CRYPTO_MDEBUG
  170.       if (call_malloc_debug) {

crypto/mem.c:178:5: 
  176.       }
  177.   #else
  178. >     osslargused(file); osslargused(line);
  179.       ret = malloc(num);
  180.   #endif

crypto/mem.c:178:24: 
  176.       }
  177.   #else
  178. >     osslargused(file); osslargused(line);
  179.       ret = malloc(num);
  180.   #endif

crypto/mem.c:179:5: 
  177.   #else
  178.       osslargused(file); osslargused(line);
  179. >     ret = malloc(num);
  180.   #endif
  181.   

crypto/mem.c:182:5: 
  180.   #endif
  181.   
  182. >     return ret;
  183.   }
  184.   

crypto/mem.c:183:1: return from a call to CRYPTO_malloc
  181.   
  182.       return ret;
  183. > }
  184.   
  185.   void *CRYPTO_zalloc(size_t num, const char *file, int line)

test/evp_test.c:1132:5: 
1130.   
1131.       mdat = OPENSSL_malloc(sizeof(*mdat));
1132. >     mdat->type = type;
1133.       mdat->alg = NULL;
1134.       mdat->key = NULL;
