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


test/evp_test.c:1203:1: start of procedure mac_test_init()
1201.   };
1202.   
1203. > static int mac_test_init(struct evp_test *t, const char *alg)
1204.   {
1205.       int type;

test/evp_test.c:1207:9: Taking true branch
1205.       int type;
1206.       struct mac_data *mdat;
1207.       if (strcmp(alg, "HMAC") == 0) {
                ^
1208.           type = EVP_PKEY_HMAC;
1209.       } else if (strcmp(alg, "CMAC") == 0) {

test/evp_test.c:1208:9: 
1206.       struct mac_data *mdat;
1207.       if (strcmp(alg, "HMAC") == 0) {
1208. >         type = EVP_PKEY_HMAC;
1209.       } else if (strcmp(alg, "CMAC") == 0) {
1210.   #ifndef OPENSSL_NO_CMAC

test/evp_test.c:1233:5: 
1231.           return 0;
1232.   
1233. >     mdat = OPENSSL_malloc(sizeof(*mdat));
1234.       mdat->type = type;
1235.       mdat->alg = NULL;

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

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

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

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

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

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

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

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

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

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

test/evp_test.c:1234:5: 
1232.   
1233.       mdat = OPENSSL_malloc(sizeof(*mdat));
1234. >     mdat->type = type;
1235.       mdat->alg = NULL;
1236.       mdat->key = NULL;
