test/evp_test.c:1516: error: NULL_DEREFERENCE
  pointer `pdat` last assigned on line 1515 could be null and is dereferenced at line 1516, column 5.
Showing all 17 steps of the trace


test/evp_test.c:1500:1: start of procedure pbe_test_init()
1498.   }
1499.   
1500. > static int pbe_test_init(struct evp_test *t, const char *alg)
1501.   {
1502.       struct pbe_data *pdat;

test/evp_test.c:1503:5: 
1501.   {
1502.       struct pbe_data *pdat;
1503. >     int pbe_type = 0;
1504.   
1505.   #ifndef OPENSSL_NO_SCRYPT

test/evp_test.c:1506:9: Taking false branch
1504.   
1505.   #ifndef OPENSSL_NO_SCRYPT
1506.       if (strcmp(alg, "scrypt") == 0)
                ^
1507.           pbe_type = PBE_TYPE_SCRYPT;
1508.   #endif

test/evp_test.c:1509:14: Taking false branch
1507.           pbe_type = PBE_TYPE_SCRYPT;
1508.   #endif
1509.       else if (strcmp(alg, "pbkdf2") == 0)
                     ^
1510.           pbe_type = PBE_TYPE_PBKDF2;
1511.       else if (strcmp(alg, "pkcs12") == 0)

test/evp_test.c:1511:14: Taking false branch
1509.       else if (strcmp(alg, "pbkdf2") == 0)
1510.           pbe_type = PBE_TYPE_PBKDF2;
1511.       else if (strcmp(alg, "pkcs12") == 0)
                     ^
1512.           pbe_type = PBE_TYPE_PKCS12;
1513.       else

test/evp_test.c:1514:9: 
1512.           pbe_type = PBE_TYPE_PKCS12;
1513.       else
1514. >         fprintf(stderr, "Unknown pbe algorithm %s\n", alg);
1515.       pdat = OPENSSL_malloc(sizeof(*pdat));
1516.       pdat->pbe_type = pbe_type;

test/evp_test.c:1515:5: 
1513.       else
1514.           fprintf(stderr, "Unknown pbe algorithm %s\n", alg);
1515. >     pdat = OPENSSL_malloc(sizeof(*pdat));
1516.       pdat->pbe_type = pbe_type;
1517.       pdat->pass = NULL;

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

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

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

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

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

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

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

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

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

test/evp_test.c:1516:5: 
1514.           fprintf(stderr, "Unknown pbe algorithm %s\n", alg);
1515.       pdat = OPENSSL_malloc(sizeof(*pdat));
1516. >     pdat->pbe_type = pbe_type;
1517.       pdat->pass = NULL;
1518.       pdat->salt = NULL;
