apps/apps.c:1452: error: NULL_DEREFERENCE
  pointer `store` last assigned on line 1430 could be null and is dereferenced by call to `X509_STORE_free()` at line 1452, column 2.
Showing all 20 steps of the trace


apps/apps.c:1426:1: start of procedure setup_verify()
1424.   }
1425.   
1426. > X509_STORE *setup_verify(BIO *bp, char *CAfile, char *CApath)
1427.   {
1428.   	X509_STORE *store;

apps/apps.c:1430:7: 
1428.   	X509_STORE *store;
1429.   	X509_LOOKUP *lookup;
1430. > 	if(!(store = X509_STORE_new())) goto end;
1431.   	lookup=X509_STORE_add_lookup(store,X509_LOOKUP_file());
1432.   	if (lookup == NULL) goto end;

crypto/x509/x509_lu.c:178:1: start of procedure X509_STORE_new()
  176.   	}
  177.   
  178. > X509_STORE *X509_STORE_new(void)
  179.   	{
  180.   	X509_STORE *ret;

crypto/x509/x509_lu.c:182:6: 
  180.   	X509_STORE *ret;
  181.   
  182. > 	if ((ret=(X509_STORE *)OPENSSL_malloc(sizeof(X509_STORE))) == NULL)
  183.   		return NULL;
  184.   	ret->objs = sk_X509_OBJECT_new(x509_object_cmp);

crypto/mem.c:295:1: start of procedure CRYPTO_malloc()
    293.   	}
    294.   
    295. > void *CRYPTO_malloc(int num, const char *file, int line)
    296.   	{
    297.   	void *ret = NULL;

crypto/mem.c:297:2: 
    295.   void *CRYPTO_malloc(int num, const char *file, int line)
    296.   	{
    297. > 	void *ret = NULL;
    298.   
    299.   	if (num <= 0) return NULL;

crypto/mem.c:299:6: Taking false branch
    297.   	void *ret = NULL;
    298.   
    299.   	if (num <= 0) return NULL;
                ^
    300.   
    301.   	allow_customize = 0;

crypto/mem.c:301:2: 
    299.   	if (num <= 0) return NULL;
    300.   
    301. > 	allow_customize = 0;
    302.   	if (malloc_debug_func != NULL)
    303.   		{

crypto/mem.c:302:6: Taking false branch
    300.   
    301.   	allow_customize = 0;
    302.   	if (malloc_debug_func != NULL)
                ^
    303.   		{
    304.   		allow_customize_debug = 0;

crypto/mem.c:307:2: Skipping __function_pointer__(): unresolved function pointer
    305.   		malloc_debug_func(NULL, num, file, line, 0);
    306.   		}
    307.   	ret = malloc_ex_func(num,file,line);
            ^
    308.   #ifdef LEVITTE_DEBUG_MEM
    309.   	fprintf(stderr, "LEVITTE_DEBUG_MEM:         > 0x%p (%d)\n", ret, num);

crypto/mem.c:311:6: Taking false branch
    309.   	fprintf(stderr, "LEVITTE_DEBUG_MEM:         > 0x%p (%d)\n", ret, num);
    310.   #endif
    311.   	if (malloc_debug_func != NULL)
                ^
    312.   		malloc_debug_func(ret, num, file, line, 1);
    313.   

crypto/mem.c:318:12: Taking false branch
    316.            * sanitisation function can't be optimised out. NB: We only do
    317.            * this for >2Kb so the overhead doesn't bother us. */
    318.           if(ret && (num > 2048))
                      ^
    319.   	{	extern unsigned char cleanse_ctr;
    320.                   ((unsigned char *)ret)[0] = cleanse_ctr;

crypto/mem.c:324:2: 
    322.   #endif
    323.   
    324. > 	return ret;
    325.   	}
    326.   char *CRYPTO_strdup(const char *str, const char *file, int line)

crypto/mem.c:325:2: return from a call to CRYPTO_malloc
    323.   
    324.   	return ret;
    325.   	}
            ^
    326.   char *CRYPTO_strdup(const char *str, const char *file, int line)
    327.   	{

crypto/x509/x509_lu.c:182:6: Taking true branch
  180.   	X509_STORE *ret;
  181.   
  182.   	if ((ret=(X509_STORE *)OPENSSL_malloc(sizeof(X509_STORE))) == NULL)
              ^
  183.   		return NULL;
  184.   	ret->objs = sk_X509_OBJECT_new(x509_object_cmp);

crypto/x509/x509_lu.c:183:3: 
  181.   
  182.   	if ((ret=(X509_STORE *)OPENSSL_malloc(sizeof(X509_STORE))) == NULL)
  183. > 		return NULL;
  184.   	ret->objs = sk_X509_OBJECT_new(x509_object_cmp);
  185.   	ret->cache=1;

crypto/x509/x509_lu.c:212:2: return from a call to X509_STORE_new
  210.   	ret->references=1;
  211.   	return ret;
  212.   	}
          ^
  213.   
  214.   static void cleanup(X509_OBJECT *a)

apps/apps.c:1430:7: Taking true branch
1428.   	X509_STORE *store;
1429.   	X509_LOOKUP *lookup;
1430.   	if(!(store = X509_STORE_new())) goto end;
              ^
1431.   	lookup=X509_STORE_add_lookup(store,X509_LOOKUP_file());
1432.   	if (lookup == NULL) goto end;

apps/apps.c:1451:2: 
1449.   	ERR_clear_error();
1450.   	return store;
1451. > 	end:
1452.   	X509_STORE_free(store);
1453.   	return NULL;

apps/apps.c:1452:2: 
1450.   	return store;
1451.   	end:
1452. > 	X509_STORE_free(store);
1453.   	return NULL;
1454.   }
