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


test/evp_test.c:829:1: start of procedure mac_test_init()
827.   } MAC_DATA;
828.   
829. > static int mac_test_init(EVP_TEST *t, const char *alg)
830.   {
831.       int type;

test/evp_test.c:834:9: Taking true branch
832.       MAC_DATA *mdat;
833.   
834.       if (strcmp(alg, "HMAC") == 0) {
               ^
835.           type = EVP_PKEY_HMAC;
836.       } else if (strcmp(alg, "CMAC") == 0) {

test/evp_test.c:835:9: 
833.   
834.       if (strcmp(alg, "HMAC") == 0) {
835. >         type = EVP_PKEY_HMAC;
836.       } else if (strcmp(alg, "CMAC") == 0) {
837.   #ifndef OPENSSL_NO_CMAC

test/evp_test.c:860:5: 
858.           return 0;
859.   
860. >     mdat = OPENSSL_zalloc(sizeof(*mdat));
861.       mdat->type = type;
862.       t->data = mdat;

crypto/mem.c:218:1: start of procedure CRYPTO_zalloc()
  216.   }
  217.   
  218. > void *CRYPTO_zalloc(size_t num, const char *file, int line)
  219.   {
  220.       void *ret = CRYPTO_malloc(num, file, line);

crypto/mem.c:220:5: 
  218.   void *CRYPTO_zalloc(size_t num, const char *file, int line)
  219.   {
  220. >     void *ret = CRYPTO_malloc(num, file, line);
  221.   
  222.       FAILTEST();

crypto/mem.c:189:1: start of procedure CRYPTO_malloc()
    187.   #endif
    188.   
    189. > void *CRYPTO_malloc(size_t num, const char *file, int line)
    190.   {
    191.       void *ret = NULL;

crypto/mem.c:191:5: 
    189.   void *CRYPTO_malloc(size_t num, const char *file, int line)
    190.   {
    191. >     void *ret = NULL;
    192.   
    193.       INCREMENT(malloc_count);

crypto/mem.c:194:9: Taking true branch
    192.   
    193.       INCREMENT(malloc_count);
    194.       if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)
                   ^
    195.           return malloc_impl(num, file, line);
    196.   

crypto/mem.c:194:32: Taking true branch
    192.   
    193.       INCREMENT(malloc_count);
    194.       if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)
                                          ^
    195.           return malloc_impl(num, file, line);
    196.   

crypto/mem.c:195:9: Skipping __function_pointer__(): unresolved function pointer
    193.       INCREMENT(malloc_count);
    194.       if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)
    195.           return malloc_impl(num, file, line);
                   ^
    196.   
    197.       if (num == 0)

crypto/mem.c:216:1: return from a call to CRYPTO_malloc
    214.   
    215.       return ret;
    216. > }
    217.   
    218.   void *CRYPTO_zalloc(size_t num, const char *file, int line)

crypto/mem.c:223:9: Taking false branch
  221.   
  222.       FAILTEST();
  223.       if (ret != NULL)
                 ^
  224.           memset(ret, 0, num);
  225.       return ret;

crypto/mem.c:225:5: 
  223.       if (ret != NULL)
  224.           memset(ret, 0, num);
  225. >     return ret;
  226.   }
  227.   

crypto/mem.c:226:1: return from a call to CRYPTO_zalloc
  224.           memset(ret, 0, num);
  225.       return ret;
  226. > }
  227.   
  228.   void *CRYPTO_realloc(void *str, size_t num, const char *file, int line)

test/evp_test.c:861:5: 
859.   
860.       mdat = OPENSSL_zalloc(sizeof(*mdat));
861. >     mdat->type = type;
862.       t->data = mdat;
863.       return 1;
